Can someone explain to me how can I open a new tab from a firefox extension, that contains HTML content from a string I have?
A:
I do not think this is possible:
Whether or not a page or tab opens is based on the user's preferences. If the user has tabbed browsing disabled, the new content will be in a new window and not a tab.
Each Browser tab requires a URL. So you would have to make a page, pass it the string as a query string or HTTP POST and then have that page return your string.
The other option is to use something like this.
Daveo
2010-04-08 22:24:12
The question said **extension**; that goes a very long way towards avoiding being tied to user preferences for how links in web pages open.
David Dorward
2010-04-08 22:31:25
A:
I think this is what you need - https://developer.mozilla.org/en/XUL/tabs#m-appendItem
Ivo Sabev
2010-04-08 22:38:25
+4
A:
gBrowser.addTab, either using a data:
URL, or opening and empty page then writing to its document. Info.
bobince
2010-04-08 22:43:28