在javascript中使用浏览器对象访问DOM

在javascript中使用浏览器对象访问DOM,javascript,firefox,firefox-addon,Javascript,Firefox,Firefox Addon,我正在用javascript编写一个firefox扩展,从该脚本中我需要使用browser窗口对象访问DOM对象。我如何做到这一点 当我在扩展中尝试window.document.deafultView.innerHeight时,我遇到了一个异常 我不知道如何使用我的插件中的window对象访问DOM对象。根据,您可以通过以下方式访问DOM: // Get the content of the currently displaying window var win = window.conten

我正在用javascript编写一个firefox扩展,从该脚本中我需要使用browser窗口对象访问DOM对象。我如何做到这一点

当我在扩展中尝试
window.document.deafultView.innerHeight
时,我遇到了一个异常

我不知道如何使用我的插件中的window对象访问DOM对象。

根据,您可以通过以下方式访问DOM:

// Get the content of the currently displaying window
var win = window.content;

// Access the document within the window as follows
win.document.getElementById(‘xyz’);

你在写什么样的扩展/插件?它是浏览器扩展吗?什么浏览器?@PascalBeyeler问题上有两个标签-
firefox
firefox插件