开发者

Can't load JS file for firefox extension

I have a working firefox extension that currently consists of a button. When I click that button, my XUL file declares oncommand="test();" which simply is an alert("hi!"); .

I am including the file like this:

  <script type="application/x-javascript"
    src="chrome://myfirstextension/content/resultscollector.js" />

the resultscollector.js f开发者_StackOverflow社区ile is right where it should be in \content , but this does not work.

But, when I simply move the file into another extensions content folder that I am testing, and change the URL I am accessing to reflect that (chrome://myotherfirstextension/content/resultscollector.js) - it works!

To add to the confusion, though both extensions show up under tools -> addons and view -> toolbars, and for that matter, on the actual toolbar, I can browse to chrome://myotherfirstextension/content/overlay.xul, whereas an attempt to browse to myfirstextensions' overlay file fails (the locationbar simply won't allow me to press enter).

If anyone can help with this, it would be greatly appreciated.


I think your chrome registration is wrong, take a look at this MDC article

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜