我正在开发 firefox 扩展,它需要用 html 文档显示弹出窗口。在 Safari 和 Chrome 中,有一种非常简单的方法来创建弹出窗口,但目前我花了 2 天的时间寻找在 Firefox 中执行相同操作的方法,但我在文档中找不到用于执行此操作的页面。
有人可以向我提供代码示例、教程或文档的链接吗,我将非常感激。
这是 Safari 中弹出窗口的图像
最佳答案
在基于 xul 的插件中,这可以通过面板来完成。如果您看到the page for the type property面板,它们有与您想要的类似的东西。
你会做的是:
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="yourToolbarbutton"
image="chrome://yourExt/content/image.png"
class="toolbarbutton-1 chromeclass-toolbar-additional">
<panel id="yourPanel"
type="arrow"
noautofocus="true"
consumeoutsideclicks="true"
onpopupshowing="functionToFillThePanel();"
level="top">
content goes here
</panel>
</toolbarbutton>
/toolbarpalette>
关于firefox - 如何在带有扩展的 Firefox 中的工具栏按钮上创建弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20306858/