Reputation: 527
I am porting a firefox extension to google chrome built using GWT.
In the linker, I need to specify $wnd and $doc variables.
The equivalent in firefox is as follows:
var $wnd = Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci.nsIAppShellService).hiddenDOMWindow;
var $doc = $wnd.document;
The attribute hiddenDOMWindow as explained here returns the (singleton) application hidden window, automatically created and maintained by this AppShellService and is Read only.
Upvotes: 0
Views: 998
Reputation: 57651
Background scripts in Chrome extensions always run inside a window (the background window). So you can just access your own window from the background script:
var $wnd = window;
var $doc = $wnd.document;
Upvotes: 2
Reputation: 4016
There is getViews() method in chrome.extension API. You can get window's document using this method.
Upvotes: 0