Skip to content

Commit

Permalink
Harden abort-current-inline-script scriplet
Browse files Browse the repository at this point in the history
Related issue:
- uBlockOrigin/uAssets#6929
  • Loading branch information
gorhill committed Feb 9, 2020
1 parent a806dd4 commit 1a85717
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 1a85717

Please sign in to comment.