Created
July 18, 2013 21:22
-
-
Save Gozala/6033211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open scratchpad, switch to chrome environment & exectue. | |
let Ci = Components.interfaces; | |
let Cc = Components.classes; | |
let addonPrincipal = Cc["@mozilla.org/systemprincipal;1"]. | |
createInstance(Ci.nsIPrincipal); | |
let docShell = Cc["@mozilla.org/appshell/appShellService;1"]. | |
getService(Ci.nsIAppShellService). | |
createWindowlessBrowser(). | |
QueryInterface(Ci.nsIInterfaceRequestor). | |
getInterface(Ci.nsIDocShell); | |
docShell.createAboutBlankContentViewer(addonPrincipal); | |
let window = docShell.contentViewer.DOMDocument.defaultView; | |
window.location = "data:application/vnd.mozilla.xul+xml;charset=utf-8,<window/>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment