5

While in dev-mode in my application, I would like to be able to have links on the page that automatically take me to a specific file in the Chrome Dev Tools.

Is there any way to generate a URL that when clicked in Chrome, opens the Dev Tools at the Sources tab and at the desired file ?

CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
  • It seems like there might be some ways you could get close, but probably not exactly. This answer/thread may be of interest https://stackoverflow.com/a/13568896/10712394 – johansenja Aug 06 '20 at 18:07

2 Answers2

2

Your requirement is somewhat specific, so I don't think it is possible (at least not natively).

You probably can achieve what you want extending DevTools with an Extension (see the documentation). This way, you can make your page interact with the extension to make it open a specific panel in Chrome Dev Tools.

Diego Queiroz
  • 3,198
  • 1
  • 24
  • 36
2

You are able to "inspect the inspector": How do you inspect the web inspector in Chrome?

Simply undock it, then inspect DevTools itself with ctrl+shift+i. Then head on over to the sources tab in original (first DevTools), inspect it, and get its URI from Elements.

Or use chrome://inspect/#other

Example URI (first part only):

devtools://devtools/bundled/toolbox.html?remoteBase=https://chrome-devtools-frontend.appspot.com/ser…
halfer
  • 19,824
  • 17
  • 99
  • 186
3ICE
  • 54
  • 6
  • 1
    Thanks! Dammit I didn't realize I would lose the chance to award the bounty. I was offline due to a medical issue – CodyBugstein Aug 09 '20 at 03:04
  • All good, I got 10 rep for this which was just enough to be able to upvote your question. I hope more people answer! Good luck and let us know how it went. – 3ICE Aug 09 '20 at 11:18
  • 1
    @CodyBugstein You marked this answer as correct, but I feel you did not tested it. Although you can inspect DevTools internals, you can't interact with it the way you want. Notice the link to Chrome DevTools is always the same in your machine, doesn't matter what URL or tab you access, and you can't just search for the component name (like a tab) to forge a link to it. If it was possible to access, in any way, internal functions of your browser from a webpage, this would be a big security flaw. Have a look into this bug, for example: https://bugs.chromium.org/p/chromium/issues/detail?id=571121 – Diego Queiroz Aug 13 '20 at 16:52
  • 1
    @DiegoQueiroz you are right, I accepted it before testing it. :( – CodyBugstein Aug 18 '20 at 03:20