2

I have this code for a Chrome Extension

chrome.tabs.create({url: chrome.extension.getURL('dist/index.html')});

is there an option I can add to this call, so that Dev Tools is automatically opened when the tab is created?

looks like there is a command line flag for a Chrome for a new window:

--auto-open-devtools-for-tabs

but not sure if this applies for single tabs

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

3

The is no way to do this now, and unlikely will ever become possible.

It seems like it was experimental API few years ago, but now it's removed.

For more information check this question.

Sergii Rudenko
  • 2,603
  • 1
  • 22
  • 24
  • maybe there is a way to programmatically open dev tools once the page has loaded? – Alexander Mills Jan 02 '18 at 02:33
  • 1
    As I know, there is no way to do this :( However, You can get programmatic access to the [devtools](https://groups.google.com/d/msg/google-chrome-developer-tools/beDuY1DGZRA/2Q8ynmc7CAAJ). – Sergii Rudenko Jan 02 '18 at 02:38
  • hmmm couldn't you just find the element on the page that has dev tools and click it somehow? or maybe that's outside of the window scope...seems really strange, maybe it's for security reasons – Alexander Mills Jan 02 '18 at 02:40
  • 1
    I don't know the way to do this :( I would suggest to check [puppeteer](https://github.com/GoogleChrome/puppeteer) and [devtools-protocol](https://chromedevtools.github.io/devtools-protocol/), maybe you will find some ideas or useful information there. – Sergii Rudenko Jan 02 '18 at 02:53