From 3d8b24e2b0b7779f03dc4cee9571b2ecd3025805 Mon Sep 17 00:00:00 2001 From: henriquez Date: Tue, 7 Apr 2020 00:07:52 -0500 Subject: fix subresource integrity hash-busting bug by only rewriting external scripts if not 'accepted' --- bg/ResponseProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bg/ResponseProcessor.js b/bg/ResponseProcessor.js index d964dab..0340a6f 100644 --- a/bg/ResponseProcessor.js +++ b/bg/ResponseProcessor.js @@ -117,7 +117,7 @@ class ResponseTextFilter { } catch (e) { console.error(e); } - if (editedText !== null) { + if (editedText !== null && editedText.indexOf('/* LibreJS: script accepted') !== 0) { // we changed the content, let's re-encode let encoded = new TextEncoder().encode(editedText); // pre-pending the UTF-8 BOM will force the charset per HTML 5 specs -- cgit v1.2.3