views:

156

answers:

1

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","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?

+2  A: 

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");
sdwilsh