Bug 1410415 - Set a sandboxName on the WebExtensions Content Script sandboxes.
MozReview-Commit-ID: aIcayH9TYd
--- a/toolkit/components/extensions/ExtensionContent.jsm
+++ b/toolkit/components/extensions/ExtensionContent.jsm
@@ -420,32 +420,34 @@ class ContentScriptContextChild extends
if (this.isExtensionPage) {
// This is an iframe with content script API enabled and its principal
// should be the contentWindow itself. We create a sandbox with the
// contentWindow as principal and with X-rays disabled because it
// enables us to create the APIs object in this sandbox object and then
// copying it into the iframe's window. See bug 1214658.
this.sandbox = Cu.Sandbox(contentWindow, {
+ sandboxName: `Content Script ExtensionPage ${this.extension.id}`,
sandboxPrototype: contentWindow,
sameZoneAs: contentWindow,
wantXrays: false,
isWebExtensionContentScript: true,
});
} else {
// This metadata is required by the Developer Tools, in order for
// the content script to be associated with both the extension and
// the tab holding the content page.
let metadata = {
"inner-window-id": this.innerWindowID,
addonId: extensionPrincipal.addonId,
};
this.sandbox = Cu.Sandbox(principal, {
metadata,
+ sandboxName: `Content Script ${this.extension.id}`,
sandboxPrototype: contentWindow,
sameZoneAs: contentWindow,
wantXrays: true,
isWebExtensionContentScript: true,
wantExportHelpers: true,
wantGlobalProperties: ["XMLHttpRequest", "fetch"],
originAttributes: attrs,
});