GoogleChrome / devtools-docs

The legacy documentation for Chrome DevTools.
https://developer.chrome.com/devtools
691 stars 180 forks source link

[extension API] devtools.panels docs clarity #121

Open paulirish opened 10 years ago

paulirish commented 10 years ago

https://developer.chrome.com/extensions/devtools_panels is a little hard to follow.

I'll try to summarize here. Two existing devtools panels can be extended: sources & elements:

chrome.devtools.panels.sources
chrome.devtools.panels.elements

The three APIs available to those objects are are:

chrome.devtools.panels.sources.onSelectionChanged.addListener
chrome.devtools.panels.sources.onSelectionChanged.removeListener
chrome.devtools.panels.sources.createSidebarPane

Then we also have these methods:

chrome.devtools.panels.setOpenResourceHandler
chrome.devtools.panels.openResource
chrome.devtools.panels.create

Then theres a slew of events available for panels and sidebar panes to bind to. And a few set… methods to display items.

The docs page is pretty muddy at explaining this stuff so we could do a better job.

nicolechung commented 9 years ago

Yes! I would like to know if it's possible to open JS files from a devtools extension I am working on.

spite commented 8 years ago

What does "Fired when an object is selected in the panel" mean for the Sources panel? I can't get onSelectionChanged to fire no matter what I do in the Sources panel.

Wizzy-wooz commented 7 years ago

Hi guys,

can someone advise how can I call from my extension "Toggle Device Toolbar" panel like paulirish mentioned:

chrome.devtools.panels.sources chrome.devtools.panels.elements

should it be chrome.devtools.panels.toggleDeviceToolbar?

Any help matters :)

Best regards,

trungdq88 commented 7 years ago

Same question: What does "Fired when an object is selected in the panel" mean for the Sources panel?

And is there any plan to support more events on the Sources Panel?

paulirish commented 7 years ago

onSelectionChanged should no longer be present on the sourcesPanel. It doesn't do anything. :)

No immediate plans to expand the events supported in sources panel, but contributions to chromium would be considered if you're up for that.

tudorilisoi commented 7 years ago

Imagine clicking on an error in devtools and have your favorite IDE open the (source-mapped) file and go to the faulty line. It could have been done with a small plugin for webpack(or any other dev server) and a little chrome devtools extension, if onSelectionChanged worked on the sources tab.