Closed
Bug 986639
Opened 11 years ago
Closed 11 years ago
Use the __URI__ property of component and module globals to detect which add-on they come from
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 31
People
(Reporter: mossop, Assigned: mossop)
References
Details
Attachments
(1 file)
11.60 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
All components and modules have a __URI__ property that defines what loaded them. We can use that to map back to the add-on in the add-on script actor.
Assignee | ||
Comment 1•11 years ago
|
||
All JS modules have a __URI__ property denoting the URI of the module loaded. We can use this to detect which globals are from add-on provided scripts by mapping them back to the add-on ID. This does that in the add-on thread actor. Pretty simple but the testcase requires bug 986757 and bug 986108 in order to work. I don't think there's a reason not to start the review now though.
Attachment #8396033 -
Flags: review?(nfitzgerald)
Comment 2•11 years ago
|
||
Comment on attachment 8396033 [details] [diff] [review]
patch rev 1
Review of attachment 8396033 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/devtools/debugger/test/browser_dbg_addon-modules.js
@@ +60,5 @@
> +
> + gThreadClient.getSources(({sources}) => {
> + ok(sources.length, "retrieved sources");
> +
> + sources.forEach(source => {
Any reason why you aren't using
for (let source of sources) ...
?
::: toolkit/devtools/server/actors/script.js
@@ +4724,5 @@
> + if (this.addonManager.mapURIToAddonID(uri, id))
> + return id.value === this.addonID;
> + }
> + catch (e) {
> + console.log("Unexpected URI " + uridescriptor.value);
DevToolsUtils.reportException("AddonThreadActor.prototype._checkGlobal",
<e or new Error("Unexpected uri:" + ...)>);
Attachment #8396033 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Assignee | ||
Comment 5•11 years ago
|
||
Realised I failed to address the review comments in my push so here they are: https://hg.mozilla.org/integration/fx-team/rev/c24b05af9a39
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•