I have a chrome extension which hooks into the devtools. Ideally I want a badge that, when clicked, opens up the devtools on the new tab which I created. Is there any way to do this from the background page?
To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).
The JavaScript console To access the console in any browser: If the developer tools are already open, click or press the Console tab. If not, Firefox allows you to open the console directly using Ctrl + Shift + K or using the menu command: Menu ➤ Web Developer ➤ Web Console, or Tools ➤ Web Developer ➤ Web Console.
To open the developer console window on Chrome, use the keyboard shortcut Ctrl Shift J (on Windows) or Ctrl Option J (on Mac). Alternatively, you can use the Chrome menu in the browser window, select the option "More Tools," and then select "Developer Tools."
On opening the developer tools, with the developer tools window in focus, press F1 . This will open a settings page. Check the "Auto-open DevTools for popups". This worked for me.
It seems unlikely that this is possible or will ever become possible,
check this: https://code.google.com/p/chromium/issues/detail?id=112277
which says: "We only allow explicit devtools opening."
Yes you can (or not) using the experimental APIs chrome.experimental.webInspector
.
http://code.google.com/chrome/extensions/experimental.html
You can even change the content and panels of it.
Note that you will not able submit extensions that use experimental APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With