I'm developing a Chrome devtools extension that gets a list of elements via content script and sends it back to my panel through the background layer. What I'd like to do is pass an element from my panel, and open that line of HTML in the elements panel.
I've looked around online, but haven't been able to find anything about this specifically.
The flow is this:
- Panel sends message to background saying "get me list of elements"
- Background sends message on to content script, which then returns a list of elements (in string form)
- Background takes list of elements from content and sends it back to the panel
The Panel draws a table of the elements, and what I'd like to do is be able to click that line of HTML in my panel, and then reveal that element in the Elements panel.
I tried this in my panel.js and my content_script.js:
chrome.devtools.inspectedWindow.eval("inspect(window.getElementById('" + $(code).attr('id') + "'))");
I've also tried that with just passing a string ID, but it didn't work.