Closed Bug 1503475 Opened 6 years ago Closed 5 years ago

Add devtools extension API devtools.panels.openResource

Categories

(WebExtensions :: Developer Tools, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1575240

People

(Reporter: Harald, Unassigned)

References

()

Details

Redux and other framework extension panels should be able to open script files.

What would make this more useful would be to make sure it is source map aware.
Severity: normal → enhancement
Priority: -- → P3
Luca, should that be in DevTools or extension component? Also, how far can you help; as you've been involved with past extension API work?
Flags: needinfo?(lgreco)
(In reply to :Harald Kirschner :digitarald from comment #1)
> Luca, should that be in DevTools or extension component? 

devtools.panels.openResource is a WebExtensions DevTools API that is also available on Chrome, and so I think that it is reasonable to consider it part of the "WebExtensions - Developer Tools" bugzilla component.

> Also, how far can you help; as you've been involved with past extension API work?

I can definitely help to co-design the API implementation and review the patches.
(or I may also be able to write the actual patches, if the timing is not too tight and I'm able to get some time to look into it for a bit)

I took a quick look at the API signature and this method doesn't seem to depend from the "devtools.inspectedWindow.Resource" API object used by the other devtools APIs related to the webpage resources (e.g. "devtools.panels.setOpenResourceHandler", devtools.inspectedWindow.getResources and devtools.inspectedWindow.onResourceAdded/onResourceCommitted), and so it seems that it may be possible to introduce an initial version of `devtools.panels.openResource` without too much additional work.

Internally the devtools toolbox provides two methods (used internally for similar reasons) named  `toolbox.viewSourceInStyleEditor(sourceURL, sourceLine)` ([1]) and `toolbox.viewSourceInDebugger(sourceURL, sourceLine, reason)` ([2]) that looks useful to put together an initial implementation of this API method.

[1]: https://searchfox.org/mozilla-central/rev/39cb1e96cf97713c444c5a0404d4f84627aee85d/devtools/client/framework/toolbox.js#3140-3146

[2]: https://searchfox.org/mozilla-central/rev/39cb1e96cf97713c444c5a0404d4f84627aee85d/devtools/client/framework/toolbox.js#3148-3154
Component: General → Developer Tools
Flags: needinfo?(lgreco)
Product: DevTools → WebExtensions

ni? Jason to dupe with inspect extension API work.

Flags: needinfo?(jlaster)

This existing bug actually solves the use case described here.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(jlaster)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.