From my devtools extension, can I programmatically access the sources panel?

Viewed 62

I'm looking at writing a devtools extension to graphically represent my app state.

Can my extension access/link to the devtools sources panel, especially the filesystem tab?

In my extension, I would need to iterate files in the filesytem tab, then construct links such that a user can click on something in my panel and we take them straight to a file in the filesystem tab.

1 Answers

You can use chrome.debugger to access the Chrome DevTools Protocol from your extension. However, the chrome.debugger page I linked to says that you can't use DevTools and chrome.debugger at the same time. So you might be able to read the list of files and construct links in your Extension and then have those links open up DevTools but you won't be able to keep them both open at the same time. Another approach might be to just surface all the relevant information / actions in your Extension. Next step from here would be to investigate the Chrome DevTools Protocol to see if it supports everything you need to do. It should because DevTools exclusively uses this protocol to communicate with the browser. So anything DevTools can do, you can do via the protocol.

Related