Skip to content

Instantly share code, notes, and snippets.

@harthur
Last active December 16, 2015 14:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harthur/5448267 to your computer and use it in GitHub Desktop.
Save harthur/5448267 to your computer and use it in GitHub Desktop.
Open a Firefox devtools window that's debugging the current browser window.
/*
* Running this scratchpad in chrome mode will open a devtools window that's debugging
* the current browser window
*/
let {devtools} = Components.utils.import("resource:///modules/devtools/gDevTools.jsm", {});
let win = Services.wm.getMostRecentWindow("navigator:browser");
let target = devtools.TargetFactory.forWindow(win);
let toolbox = gDevTools.showToolbox(target, "styleeditor", "window");
@harthur
Copy link
Author

harthur commented Apr 23, 2013

To run this, first enable chrome debugging:

  1. Open 'about:config' in the url bar
  2. Toggle the "devtools.chrome.enabled" preference to true

Then open a scratchpad:

  1. Tools > Web Developer > Scratchpad
  2. Set the scratchpad to "chrome" mode with Environment > Browser
  3. Copy the above code into the scratchpad and run it (Cmd-R / Ctrl-R)

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