From 89985360b002aba1e6a9725109e37e38265f0096 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 2 Sep 2018 18:09:49 +0200 Subject: Internal refactoring of htmlEdit() using idiomatic asynchronous ES for better maintainability and fixing problematic Promise usage. --- bg/ResponseProcessor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bg') diff --git a/bg/ResponseProcessor.js b/bg/ResponseProcessor.js index e3d6c45..1af8cd7 100644 --- a/bg/ResponseProcessor.js +++ b/bg/ResponseProcessor.js @@ -101,8 +101,9 @@ class ResponseTextFilter { } catch(e) { console.error(e); } - if (metaData.forcedUTF8 && request.type !== "script" || - editedText !== null && response.text !== editedText) { + if (editedText !== null && + (metaData.forcedUTF8 && request.type !== "script" || + response.text !== editedText)) { // if we changed the charset, the text or both, let's re-encode filter.write(new TextEncoder().encode(editedText)); } else { -- cgit v1.2.3