开发者

HTML in new tab

开发者 https://www.devze.com 2022-12-25 23:04 出处:网络
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

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

精彩评论

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

关注公众号