1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-31 07:51:21 +01:00

innerHTML setter broke pages -> 0.5.9.1

This commit is contained in:
kkapsner 2019-05-28 23:34:27 +02:00
parent ec3b7a9a26
commit 036c7cdbd0
2 changed files with 8 additions and 4 deletions

View File

@ -15,7 +15,6 @@
scope.protect = function protect(window, wrappedWindow, singleCallback, allCallback){
[window.HTMLIFrameElement, window.HTMLFrameElement].forEach(function(constructor){
var oldContentWindowGetter = constructor.prototype.__lookupGetter__("contentWindow");
Object.defineProperty(
@ -72,7 +71,10 @@
"replaceWith"
],
getters: [],
setters: ["innerHTML", "outerHTML"]
setters: [
"innerHTML",
"outerHTML"
]
}
].forEach(function(protectionDefinition){
const object = protectionDefinition.object;
@ -102,9 +104,11 @@
});
protectionDefinition.setters.forEach(function(property){
const descriptor = Object.getOwnPropertyDescriptor(object, property);
const setter = descriptor.set;
const temp = eval(`({
set ${property}(value){
const ret = this.${property} = value;
const ret = setter.call(this, value);
// const ret = this.${property} = value;
allCallback();
return ret;
}

View File

@ -2,7 +2,7 @@
{
"name": "CanvasBlocker",
"description": "__MSG_addon_description__",
"version": "0.5.10",
"version": "0.5.9.1",
"icons": {
"48": "icons/icon.svg",
"96": "icons/icon.svg"