Skip to content

Instantly share code, notes, and snippets.

@Gozala
Created July 18, 2013 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gozala/6033211 to your computer and use it in GitHub Desktop.
Save Gozala/6033211 to your computer and use it in GitHub Desktop.
// 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