1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Trying to get wrappedJSObject of an wrappedJSObject is wrong...

Fixes #133 and #134.
This commit is contained in:
kkapsner 2017-10-07 23:26:04 +02:00
parent 42ee6e483e
commit eb62521adc
4 changed files with 17 additions and 8 deletions

View file

@ -8,6 +8,7 @@
const {ask} = require("./askForPermission.js");
const lists = require("./lists.js");
const {check: originalCheck, checkStack: originalCheckStack} = require("./check.js");
const getWrapped = require("sdk/getWrapped");
const logging = require("./logging");
const {error, warning, message, notice, verbose, setPrefix: setLogPrefix} = logging;
@ -100,11 +101,11 @@
{check, checkStack, ask: askWrapper, notify, prefs}
);
message("prepare to intercept (i)frames.");
[window.HTMLIFrameElement, window.HTMLFrameElement].forEach(function(constructor){
var oldContentWindowGetter = constructor.prototype.__lookupGetter__("contentWindow");
Object.defineProperty(
constructor.prototype.wrappedJSObject,
getWrapped(constructor.prototype),
"contentWindow",
{
enumerable: true,
@ -118,7 +119,7 @@
);
var oldContentDocumentGetter = constructor.prototype.__lookupGetter__("contentDocument");
Object.defineProperty(
constructor.prototype.wrappedJSObject,
getWrapped(constructor.prototype),
"contentDocument",
{
enumerable: true,