From 9b01b503e2749c3ccd4a26bbf7ac21347920d47b Mon Sep 17 00:00:00 2001 From: JustOff Date: Tue, 25 Feb 2020 15:14:28 +0200 Subject: [PATCH] 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. --- assets/resources/resources.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/resources/resources.txt b/assets/resources/resources.txt index bff2670cb..eae7f1daa 100644 --- a/assets/resources/resources.txt +++ b/assets/resources/resources.txt @@ -1486,6 +1486,7 @@ abort-current-inline-script.js application/javascript desc.get instanceof Function === false ) { value = owner[prop]; + desc = undefined; } var magic = String.fromCharCode(Date.now() % 26 + 97) + Math.floor(Math.random() * 982451653 + 982451653).toString(36); @@ -1503,11 +1504,17 @@ abort-current-inline-script.js application/javascript Object.defineProperty(owner, prop, { get: function() { validate(); - return value; + return desc instanceof Object + ? desc.get() + : value; }, set: function(a) { validate(); - value = a; + if ( desc instanceof Object ) { + desc.set(a); + } else { + value = a; + } } }); var oe = window.onerror;