0

私は javascript で firefox 拡張機能を作成しています。そのスクリプトから、ブラウザ ウィンドウ オブジェクトを使用して DOM オブジェクトにアクセスする必要があります。どうすればこれを達成できますか?

window.document.deafultView.innerHeight拡張機能を試したところ、例外が発生しました。

プラグインから window オブジェクトを使用して DOM オブジェクトにアクセスする方法がわかりません。

4

1 に答える 1

2

http://semanticvoid.com/blog/2006/06/01/accessing-the-dom-from-within-the-firefox-extension/によると、次の方法で 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’);
于 2012-07-27T11:13:36.363 に答える