1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Harden abort-current-inline-script scriplet

Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/6929
This commit is contained in:
Raymond Hill 2020-02-09 10:35:18 -05:00
parent a806dd4bd2
commit 1a8571755e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -55,11 +55,16 @@
owner = owner[prop];
if ( owner instanceof Object === false ) { return; }
}
let value;
const desc = Object.getOwnPropertyDescriptor(owner, prop);
if ( desc && desc.get !== undefined ) { return; }
if (
desc instanceof Object === false ||
desc.get instanceof Function === false
) {
value = owner[prop];
}
const magic = String.fromCharCode(Date.now() % 26 + 97) +
Math.floor(Math.random() * 982451653 + 982451653).toString(36);
let value = owner[prop];
const validate = function() {
const e = document.currentScript;
if (