开发者

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:

  1. 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.

  2. 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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜