1

I have a chrome extension I am working on, which lives in a devtools panel (http://developer.chrome.com/extensions/devtools.panels.html).

I want to add a button to quickly open up my extension. I added a browser_action button just fine, but I can't find any information on launching developer tools from a browser action.

Is there a way to open developers tools and switch to my pane from a browser action button?

MrGlass
  • 9,094
  • 17
  • 64
  • 89
  • 1
    Duplicate (question from 2011; Rob W confirms that as of at least 3/2012 there was no way to do it): [Can I programmatically open the devtools from a Google Chrome extension?](http://stackoverflow.com/questions/6801577/can-i-programmatically-open-the-devtools-from-a-google-chrome-extension) – apsillers Jun 05 '13 at 20:06
  • @apsillers post that as an answer and I will accept. – MrGlass Jun 05 '13 at 20:46

1 Answers1

2

It seems unlikely that this is possible or will ever become possible. From Chromium Issue 112277:

We only allow explicit devtools opening.

While the issue described there is slightly different from your use case, your needs still seem to run contrary to the requirement of "explicit dev tools opening".

I read "explicit devtools opening" to mean "only open devtools when the user explicitly requests devtools". This reading is incompatible with allowing extension buttons to open developer tools. You could have a button that appeared to do something (say, redirect you to a website) but when clicked, actually opened developer tools -- you've just opened dev tools without the user explicitly asking for it, which is inconsistent with my reading of "explicit devtools opening".

Consider the theoretical statement, "We only allow explicit deletion of user data." Certainly that directive would preclude allowing an arbitrary extension button from deleting user data, wouldn't it? Even if the user explicitly clicked on a button, they didn't explicitly opt to perform a delete.

Perhaps you could read "explicit devtools opening" more loosely to mean "open devtools only in direct response to user action" which would leave open the possibility of future support for this functionality.

apsillers
  • 112,806
  • 17
  • 235
  • 239
  • 1
    I feel like the user clicking a button is pretty explicit. Your right though, they may just not allow it. – MrGlass Jun 05 '13 at 19:40
  • 1
    The context there (feature request in chromium project) is way different from the context here (extension running code based on user action), so I'm holding out hope that theres an API call somewhere that I cant find – MrGlass Jun 05 '13 at 20:00