Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save Noitidart/9384992 to your computer and use it in GitHub Desktop.

Select an option

Save Noitidart/9384992 to your computer and use it in GitHub Desktop.
_ff-addon-snippet-contentWindowQIToDOMWin: How to get nsIDOMWindow from contentWindow
var DOMWin = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
@Noitidart
Copy link
Copy Markdown
Author

README

Rev1

  • Working snippet however win is undefined you have to define that as a contetnWindow

Rev2

  • Updated file name to include snippet as word

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment