From 2282215e1cb0f9fb0974fba5d16ca5fb9c5bcc57 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 25 Aug 2023 07:28:50 -0400 Subject: [PATCH] Use `globalThis` instead of `self` in scriptlet helper Related discussion: https://github.com/uBlockOrigin/uBlock-issues/discussions/2768 --- assets/resources/scriptlets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index ae3006998..b2560d3f8 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -45,6 +45,7 @@ function safeSelf() { if ( scriptletGlobals.has('safeSelf') ) { return scriptletGlobals.get('safeSelf'); } + const self = globalThis; const safe = { 'Error': self.Error, 'Object_defineProperty': Object.defineProperty.bind(Object),