mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
innerHTML setter broke pages -> 0.5.9.1
This commit is contained in:
parent
ec3b7a9a26
commit
036c7cdbd0
2 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue