开发者

open new window from firefox extension gets Access denied

I'm writing a firefox extension. In this extension i need to open a new tab to display some analytics and data. I have a template html file which i placed in my chrome/content folder.

When i try the following code:

var w = content.window.open("chrome://myplugin/content/search.html开发者_JAVA技巧","My Plugin");

i get the following error:

Access to 'chrome://myplugin/content/search.html' from script denied

is there a way to open a new window and to set its URL to a file in the chrome directory? or is there a better way to load the content into a new window?


Your problem is content before window. This means that you are using the content's window object, which does not have permission to open a chrome URI. In this case, you just want this:

var w = window.open("chrome://myplugin/content/search.html","My Plugin");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜