Bug 1107443 part 5. Fix the addon SDK to not try defining non-configurable properties on content windows. r=mossop

This commit is contained in:
Boris Zbarsky 2015-01-23 09:54:15 -05:00
parent 77d4a9794b
commit ffc736c1a3
2 changed files with 4 additions and 2 deletions

View File

@ -193,7 +193,8 @@ const WorkerSandbox = Class({
// `addon` in document is equivalent to `self` in content script. // `addon` in document is equivalent to `self` in content script.
if (requiresAddonGlobal(worker)) { if (requiresAddonGlobal(worker)) {
Object.defineProperty(getUnsafeWindow(window), 'addon', { Object.defineProperty(getUnsafeWindow(window), 'addon', {
value: content.self value: content.self,
configurable: true
} }
); );
} }

View File

@ -238,7 +238,8 @@ const WorkerSandbox = EventEmitter.compose({
if (worker._injectInDocument) { if (worker._injectInDocument) {
let win = window.wrappedJSObject ? window.wrappedJSObject : window; let win = window.wrappedJSObject ? window.wrappedJSObject : window;
Object.defineProperty(win, "addon", { Object.defineProperty(win, "addon", {
value: content.self value: content.self,
configurable: true
} }
); );
} }