Closed Bug 1245718 Opened 9 years ago Closed 9 years ago

Provide access to the background page

Categories

(DevTools :: about:debugging, defect, P3)

43 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1005193

People

(Reporter: andy+bugzilla, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

If an add-on is a WebExtension, it would be nice to provide access to the background page through a background page button or link. Chrome has a similar button that links to that page and automatically opens the dev tools, allowing to inspect the background page and the add-on contents. (This might be a big bug)
Blocks: 1226743
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
I think when bug 1005193 is done, this will be possible, this is to track the UX needed for that.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
The UI for this could be simple – just a text link or a button. But the actual implementation – opening devtools that show add-on contents – may be hard? One of the difficulty that will arise from this is that it creates three different devtools that needs to be distinguished to each other: one that you use to inspect websites, inspect add-on contents, and inspect the browser itself (browser toolbox). But if they’re not usually opened side by side, maybe there’s not so much need in differentiating?
Depends on: 1005193
Alex, is this something you would like to look into or mentor?
Flags: needinfo?(poirot.alex)
Priority: -- → P3
I could mentor. Regarding the UX. Today we open a browser toolbox for the bootstrap.js related to the addon, but we could instead connect to the background page? (In reply to Andy McKay [:andym] from comment #0) > If an add-on is a WebExtension, it would be nice to provide access to the > background page through a background page button or link. Chrome has a > similar button that links to that page and automatically opens the dev > tools, allowing to inspect the background page **and the add-on contents**. "And the add-on contents" is more problematic. I imagine you meant popup documents and things like this? The addon toolbox can easily expose all javascript files in the debugger as soon as their sandboxes are correctly flagged as being part of the addon. Like this, via the Principal used for the sandboxes: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/extensions/Extension.jsm#1110 But for the Inspector panel, it will be more complex. We currently don't have a way to filter all documents by principal. A first and easy iteration could be to only target the background page. "DEBUG" button from about:debugging would open a Addon toolbox debugging the background page (in the inspector) and all addon scripts (in the debugger). A second iteration would allow debugging other documents.
Flags: needinfo?(poirot.alex)
Mentor: poirot.alex
I think actually that :johannh has got this in bug 1005193, which he demonstrated at the Berlin work week where clicking debug on an add-on triggered the web console with a context set to the background page. I think when that lands, there might not be anything to do here. Looks like he's looking for help on the tests if you know anything about that though :janx.
Ok, I tried to help him about tests on that bug. Yes it sounds like his patch is going to at least allow targetting the background page. Feel free to morph this bug or open other ones if you care about debugging "other add-on contents" as I described in comment 5.
Sounds good, debugging "other add-on contents" feels like like next level stuff and I'd be really happy just to get bug 1005193. I never should have doubted kmag who duped this in the first place.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.