aboutsummaryrefslogtreecommitdiff
path: root/bg
diff options
context:
space:
mode:
authorhackademix <giorgio@maone.net>2018-09-02 18:09:49 +0200
committerhackademix <giorgio@maone.net>2018-09-02 18:09:49 +0200
commit89985360b002aba1e6a9725109e37e38265f0096 (patch)
treea651f65ae8dd847d908eae02194c907320190023 /bg
parenta8d4d4b9ff1076e0755fa357870845323ae6c4a7 (diff)
Internal refactoring of htmlEdit() using idiomatic asynchronous ES for better maintainability and fixing problematic Promise usage.
Diffstat (limited to 'bg')
-rw-r--r--bg/ResponseProcessor.js5
1 files changed, 3 insertions, 2 deletions
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 {