From cbf24a40b66bf5ebfed36e36303b03950f48a4fe Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 17 Dec 2025 12:49:27 -0500 Subject: [PATCH] Fix soft regression in scriptlets proxying `fetch()` Related commit: https://github.com/gorhill/uBlock/commit/13612d1d29 Related issue: https://github.com/uBlockOrigin/uAssets/issues/30158 --- src/js/resources/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/resources/utils.js b/src/js/resources/utils.js index 4a10611bd..45c96ca32 100644 --- a/src/js/resources/utils.js +++ b/src/js/resources/utils.js @@ -67,7 +67,7 @@ export function collateFetchArgumentsFn(resource, options) { const props = [ 'body', 'cache', 'credentials', 'duplex', 'headers', 'integrity', 'keepalive', 'method', 'mode', 'priority', - 'redirect', 'referrer', 'referrerPolicy', 'signal', 'url' + 'redirect', 'referrer', 'referrerPolicy', 'url' ]; const out = {}; if ( collateFetchArgumentsFn.collateKnownProps === undefined ) { @@ -84,7 +84,12 @@ export function collateFetchArgumentsFn(resource, options) { ) { out.url = `${resource}`; } else { - collateFetchArgumentsFn.collateKnownProps(resource, out); + let clone; + try { + clone = safe.Request_clone.call(resource); + } catch { + } + collateFetchArgumentsFn.collateKnownProps(clone || resource, out); } if ( typeof options === 'object' && options !== null ) { collateFetchArgumentsFn.collateKnownProps(options, out);