From 17d30343c5a63bd6d1a57f2859aa138948fac881 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 14 Oct 2023 08:03:29 -0400 Subject: [PATCH] Use safe Array.from() in `no-xhr-if` scriptlet Related issue: https://github.com/uBlockOrigin/uAssets/issues/20063 --- assets/resources/scriptlets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 8114a59b5..c5892d2f6 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -47,6 +47,7 @@ function safeSelf() { } const self = globalThis; const safe = { + 'Array_from': Array.from, 'Error': self.Error, 'Math_floor': Math.floor, 'Math_random': Math.random, @@ -930,7 +931,7 @@ function matchObjectProperties(propNeedles, ...objs) { } const safe = safeSelf(); const haystack = {}; - const props = [ ...propNeedles.keys() ]; + const props = safe.Array_from(propNeedles.keys()); for ( const obj of objs ) { if ( obj instanceof Object === false ) { continue; } matchObjectProperties.extractProperties(obj, haystack, props);