HTML in new tab
Can someone expla开发者_如何学编程in to me how can I open a new tab from a firefox extension, that contains HTML content from a string I have?
gBrowser.addTab, either using a data:
URL, or opening and empty page then writing to its document. Info.
I think this is what you need - https://developer.mozilla.org/en/XUL/tabs#m-appendItem
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.
精彩评论