除了 Firefox 扩展中的覆盖之外,还添加对话框 XUL
我正在尝试使用 XUL 将对话框添加到已定义覆盖 xul 的 Firefox 扩展中。我尝试在同一个overlay.xul 文件中添加对话框代码,但在错误控制台中遇到“dialog.getButton 不是函数”错误。文件的结构如下所示:
<overlay id="xxx" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
... code...
<dialog id="yyy"
buttons=","
onload="onLoad();">
....
</dialog>
</overlay>
如果我将对话框 xul 代码分离到不同的文件中,那么一切似乎都可以工作。不同之处在于,在单独的dialog.xul 文件中,对话框代码如下所示:
<dialog id=yyy"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons=","
onload="onLoad();">
...
</dialog>
Is it possible or right to add thedialog code in the same override XUL file or should I 实际上将它们分开?同一扩展名可以有多个 XUL 文件吗?
I am trying to add a dialog box using XUL to a Firefox extension that already has an overlay xul defined. I tried adding the dialog code in the same overlay.xul file, but run into a "dialog.getButton is not a function" error in the Error Console. The structure of the file looks like this:
<overlay id="xxx" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
... code...
<dialog id="yyy"
buttons=","
onload="onLoad();">
....
</dialog>
</overlay>
If I separate out the dialog xul code into a different file, then everything seems to work. The difference is that in the separate dialog.xul file, the dialog code looks like this:
<dialog id=yyy"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons=","
onload="onLoad();">
...
</dialog>
Is it possible or correct to add the dialog code in the same overlay XUL file or should I actually separate them? Is it ok to have multiple XUL files for the same extension?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
?
是的。
是的。
您的扩展中可以包含任意数量的 XUL 文件。每个 XUL 文档都应该位于一个单独的文件中 - 因为文档的根标签很重要。覆盖层应使用
和常规窗口
作为其根标记,对话框需要使用根标记。
。No.
Yes.
Yes.
You can have as many XUL files in your extension as you want. Each XUL document should be in a separate file - already because the root tag of the document matters. An overlay should have
<overlay>
as its root tag, a dialog needs to use the root tag<dialog>
and a regular window<window>
.