mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051224 - Use the opt-out for the webconsole helpers. r=ochameau
This commit is contained in:
parent
c5fd483020
commit
ec4a87485a
@ -933,13 +933,31 @@ WebConsoleActor.prototype =
|
|||||||
};
|
};
|
||||||
JSTermHelpers(helpers);
|
JSTermHelpers(helpers);
|
||||||
|
|
||||||
// Make sure the helpers can be used during eval.
|
let evalWindow = this.evalWindow;
|
||||||
|
function maybeExport(obj, name) {
|
||||||
|
if (typeof obj[name] != "function") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// By default, chrome-implemented functions that are exposed to content
|
||||||
|
// refuse to accept arguments that are cross-origin for the caller. This
|
||||||
|
// is generally the safe thing, but causes problems for certain console
|
||||||
|
// helpers like cd(), where we users sometimes want to pass a cross-origin
|
||||||
|
// window. To circumvent this restriction, we use exportFunction along
|
||||||
|
// with a special option designed for this purpose. See bug 1051224.
|
||||||
|
obj[name] =
|
||||||
|
Cu.exportFunction(obj[name], evalWindow, { allowCrossOriginArguments: true });
|
||||||
|
}
|
||||||
for (let name in helpers.sandbox) {
|
for (let name in helpers.sandbox) {
|
||||||
let desc = Object.getOwnPropertyDescriptor(helpers.sandbox, name);
|
let desc = Object.getOwnPropertyDescriptor(helpers.sandbox, name);
|
||||||
if (desc.get || desc.set) {
|
maybeExport(desc, 'get');
|
||||||
continue;
|
maybeExport(desc, 'set');
|
||||||
|
maybeExport(desc, 'value');
|
||||||
|
if (desc.value) {
|
||||||
|
// Make sure the helpers can be used during eval.
|
||||||
|
desc.value = aDebuggerGlobal.makeDebuggeeValue(desc.value);
|
||||||
}
|
}
|
||||||
helpers.sandbox[name] = aDebuggerGlobal.makeDebuggeeValue(desc.value);
|
Object.defineProperty(helpers.sandbox, name, desc);
|
||||||
}
|
}
|
||||||
return helpers;
|
return helpers;
|
||||||
},
|
},
|
||||||
|
@ -1583,7 +1583,7 @@ function JSTermHelpers(aOwner)
|
|||||||
return aOwner.makeDebuggeeValue(aOwner.selectedNode)
|
return aOwner.makeDebuggeeValue(aOwner.selectedNode)
|
||||||
},
|
},
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: false
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user