mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-05-19 19:02:21 +02:00
innerHTML setter broke pages -> 0.5.9.1
This commit is contained in:
parent
ec3b7a9a26
commit
036c7cdbd0
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
scope.protect = function protect(window, wrappedWindow, singleCallback, allCallback){
|
scope.protect = function protect(window, wrappedWindow, singleCallback, allCallback){
|
||||||
|
|
||||||
|
|
||||||
[window.HTMLIFrameElement, window.HTMLFrameElement].forEach(function(constructor){
|
[window.HTMLIFrameElement, window.HTMLFrameElement].forEach(function(constructor){
|
||||||
var oldContentWindowGetter = constructor.prototype.__lookupGetter__("contentWindow");
|
var oldContentWindowGetter = constructor.prototype.__lookupGetter__("contentWindow");
|
||||||
Object.defineProperty(
|
Object.defineProperty(
|
||||||
@ -72,7 +71,10 @@
|
|||||||
"replaceWith"
|
"replaceWith"
|
||||||
],
|
],
|
||||||
getters: [],
|
getters: [],
|
||||||
setters: ["innerHTML", "outerHTML"]
|
setters: [
|
||||||
|
"innerHTML",
|
||||||
|
"outerHTML"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
].forEach(function(protectionDefinition){
|
].forEach(function(protectionDefinition){
|
||||||
const object = protectionDefinition.object;
|
const object = protectionDefinition.object;
|
||||||
@ -102,9 +104,11 @@
|
|||||||
});
|
});
|
||||||
protectionDefinition.setters.forEach(function(property){
|
protectionDefinition.setters.forEach(function(property){
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(object, property);
|
const descriptor = Object.getOwnPropertyDescriptor(object, property);
|
||||||
|
const setter = descriptor.set;
|
||||||
const temp = eval(`({
|
const temp = eval(`({
|
||||||
set ${property}(value){
|
set ${property}(value){
|
||||||
const ret = this.${property} = value;
|
const ret = setter.call(this, value);
|
||||||
|
// const ret = this.${property} = value;
|
||||||
allCallback();
|
allCallback();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"name": "CanvasBlocker",
|
"name": "CanvasBlocker",
|
||||||
"description": "__MSG_addon_description__",
|
"description": "__MSG_addon_description__",
|
||||||
"version": "0.5.10",
|
"version": "0.5.9.1",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "icons/icon.svg",
|
"48": "icons/icon.svg",
|
||||||
"96": "icons/icon.svg"
|
"96": "icons/icon.svg"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user