Open XUL in a new tab/window using Addon-SDK

2019-05-10 06:52发布

It seems possible according to 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.

I added a chrome.manifest as instructed with content:

content my_addon content/

and put .xul file under chrome/content:

myxul.xul

then I use tabs.open in main.js:

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

It returns "File not found" as the new tab is opened:

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

Thanks!

1条回答
放我归山
2楼-- · 2019-05-10 07:23

Change the line of the chrome.manifest to

content my_addon chrome/content/
查看更多
登录 后发表回答