From 40ea9d69d5d039bf0681cb84729641e33d156bc3 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 16 Mar 2020 08:47:34 -0400 Subject: [PATCH] Fix regression in set-constant scriptlet Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/947 `Object.prototype` is not an instance of `Object`, but yet is still a JS object; thus the solution is to additionally compare against `typeof`. --- assets/resources/scriptlets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index a8900800c617e..47c7399d271a1 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -549,7 +549,7 @@ const prop = chain.slice(0, pos); let v = owner[prop]; chain = chain.slice(pos + 1); - if ( v instanceof Object ) { + if ( v instanceof Object || typeof v === 'object' ) { makeProxy(v, chain); return; }