开发者

Display 'Hello World' with a Firefox extension

开发者 https://www.devze.com 2023-03-02 01:48 出处:网络
Does somebody know of a way to display \'Hello World\' in a blank pag开发者_运维知识库e when a user of Firefox opens a new tab (with an extension) ?Use this on your XUL file:

Does somebody know of a way to display 'Hello World' in a blank pag开发者_运维知识库e when a user of Firefox opens a new tab (with an extension) ?


Use this on your XUL file:

gBrowser.addEventListener("DOMContentLoaded",
    function(e) {
        var contentWindow = e.originalTarget.defaultView;

        contentWindow//.getElementById, tagName, etc...

    }, false);

contentWindow is the wrapped window of that tab.

For the raw window (Same window if you type a script on the address bar) see this.

0

精彩评论

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