使用Addon-SDK在新选项卡/窗口中打开XUL

时间:2014-03-22 18:24:12

标签: javascript firefox firefox-addon xul firefox-addon-sdk

似乎可以根据https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/XUL_Migration_Guide

you can register a chrome: URI, with a skin and locale, and this means you can include XUL windows in an SDK-based add-on.

我按照内容指示添加了chrome.manifest:

content my_addon content/

并将.xul文件放在chrome / content:

myxul.xul

然后我在main.js中使用tabs.open:

tabs.open("chrome://my_addon/content/myxul.xul");

它返回"找不到文件"当新标签打开时:

Firefox can't find the file at chrome://my_addon/content/myxul.xul.

谢谢!

1 个答案:

答案 0 :(得分:2)

将chrome.manifest的行更改为

content my_addon chrome/content/