开发者

Firefox : Difference between window, document, document.content & content

开发者 https://www.devze.com 2023-03-09 09:52 出处:网络
Developing an extension in Firefox and seems my mistakes are stemming from the fact that I don\'t understand the differences between what the below mean.

Developing an extension in Firefox and seems my mistakes are stemming from the fact that I don't understand the differences between what the below mean.

Would be great if someone could point, when exactly to use them.

Can someone who has worked with Firefox explain it please. I've added what I understand and they might very well be completely incorrect -

开发者_如何学JAVA

window

document = XUL elements + ( Web page of the current open tab)

document.content

content.document = The content of the web page of the tab open. Does not include the xul elements.

top.window.content

I'll collect the the correct explanation for the answers and put them in the question as an edit.


In an extension, document is the XUL document for the browser's UI. window is the window for that document (the object used as the script global for the chrome JS, etc). content.document is the document object for the web page in the currently selected tab. content is the window object for the web page in the currently selected tab.

0

精彩评论

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