mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Allow re-entrance in abort-current-inline-script
Related feedback: - https://github.com/DandelionSprout/adfilt/issues/7#issuecomment-590391877 If a property is already trapped with a getter/setter, propagate to these after validation succeed.
This commit is contained in:
parent
60348c4624
commit
034c915f3b
@ -56,12 +56,13 @@
|
|||||||
if ( owner instanceof Object === false ) { return; }
|
if ( owner instanceof Object === false ) { return; }
|
||||||
}
|
}
|
||||||
let value;
|
let value;
|
||||||
const desc = Object.getOwnPropertyDescriptor(owner, prop);
|
let desc = Object.getOwnPropertyDescriptor(owner, prop);
|
||||||
if (
|
if (
|
||||||
desc instanceof Object === false ||
|
desc instanceof Object === false ||
|
||||||
desc.get instanceof Function === false
|
desc.get instanceof Function === false
|
||||||
) {
|
) {
|
||||||
value = owner[prop];
|
value = owner[prop];
|
||||||
|
desc = undefined;
|
||||||
}
|
}
|
||||||
const magic = String.fromCharCode(Date.now() % 26 + 97) +
|
const magic = String.fromCharCode(Date.now() % 26 + 97) +
|
||||||
Math.floor(Math.random() * 982451653 + 982451653).toString(36);
|
Math.floor(Math.random() * 982451653 + 982451653).toString(36);
|
||||||
@ -79,12 +80,18 @@
|
|||||||
Object.defineProperty(owner, prop, {
|
Object.defineProperty(owner, prop, {
|
||||||
get: function() {
|
get: function() {
|
||||||
validate();
|
validate();
|
||||||
return value;
|
return desc instanceof Object
|
||||||
|
? desc.get()
|
||||||
|
: value;
|
||||||
},
|
},
|
||||||
set: function(a) {
|
set: function(a) {
|
||||||
validate();
|
validate();
|
||||||
|
if ( desc instanceof Object ) {
|
||||||
|
desc.set(a);
|
||||||
|
} else {
|
||||||
value = a;
|
value = a;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const oe = window.onerror;
|
const oe = window.onerror;
|
||||||
window.onerror = function(msg) {
|
window.onerror = function(msg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user