Skip to content

Commit 1a85717

Browse files
committed
Harden abort-current-inline-script scriplet
Related issue: - uBlockOrigin/uAssets#6929
1 parent a806dd4 commit 1a85717

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

assets/resources/scriptlets.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@
5555
owner = owner[prop];
5656
if ( owner instanceof Object === false ) { return; }
5757
}
58+
let value;
5859
const desc = Object.getOwnPropertyDescriptor(owner, prop);
59-
if ( desc && desc.get !== undefined ) { return; }
60+
if (
61+
desc instanceof Object === false ||
62+
desc.get instanceof Function === false
63+
) {
64+
value = owner[prop];
65+
}
6066
const magic = String.fromCharCode(Date.now() % 26 + 97) +
6167
Math.floor(Math.random() * 982451653 + 982451653).toString(36);
62-
let value = owner[prop];
6368
const validate = function() {
6469
const e = document.currentScript;
6570
if (

0 commit comments

Comments
 (0)