我正在创建一个 Firefox 扩展,它在工具栏上有一个按钮,该按钮将显示在我将设置的自定义内容下方。
我正在使用 XUL 文件来创建此内容的结构,并且像这样打开它:
var config = { confirm: false ,
username:"",
password:""};
window.openDialog( "chrome://myext/content/login.xul",
"",
"centerscreen=no,all=no,titlebar=no,chrome=yes,
toolbar=no,dialog=no,resizable=no,modal=yes",
config);
现在我采用另一种方法,通过在面板内使用 iframe 来动态使用多个 xul 文件中的一个作为 src。这是xul:
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="myextToolbarIcon"
image='chrome://myext/content/images/myext-mini-logo.png'
type="panel"
class="toolbarbutton-1 chromeclass-toolbar-additional"
tooltiptext="myext">
<panel id="myext-panel"
type="arrow"
noautofocus="true"
consumeoutsideclicks="true"
onpopupshowing="startscreen(event);"
level="top">
<hbox id="myext-panel-container" align="top">
<iframe id="myext-toolbar-menu" flex="1"/>
</hbox>
</panel>
</toolbarbutton>
</toolbarpalette>
是否有类似的方式将“配置”变量发送到 xul 文件,就像 openDialog 一样?