From d7063a052f26e5867f2501b673aaa2d5cd89b4bb Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 22 Dec 2023 10:15:37 -0500 Subject: [PATCH] Improve `xml-prune` scriptlet Related issue: https://github.com/uBlockOrigin/uAssets/issues/21532 --- assets/resources/scriptlets.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index c198fb501..2015b1b2f 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -2977,6 +2977,9 @@ function xmlPrune( type === '' && thisArg.responseXML instanceof XMLDocument ) { pruneFromDoc(thisArg.responseXML); + const serializer = new XMLSerializer(); + const textout = serializer.serializeToString(thisArg.responseXML); + Object.defineProperty(thisArg, 'responseText', { value: textout }); return; } if (