开发者

Display 'Hello World' with a Firefox extension

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜