当Firefox的用户打开新标签(带扩展名)时,有人知道在空白页面中显示“Hello World”的方法吗?
答案 0 :(得分:0)
在您的XUL文件中使用它:
gBrowser.addEventListener("DOMContentLoaded",
function(e) {
var contentWindow = e.originalTarget.defaultView;
contentWindow//.getElementById, tagName, etc...
}, false);
contentWindow
是该标签的包裹window
。
raw window (Same window if you type a script on the address bar) see this。