diff options
author | hackademix <giorgio@maone.net> | 2018-09-02 18:09:49 +0200 |
---|---|---|
committer | hackademix <giorgio@maone.net> | 2018-09-02 18:09:49 +0200 |
commit | 89985360b002aba1e6a9725109e37e38265f0096 (patch) | |
tree | a651f65ae8dd847d908eae02194c907320190023 /bg | |
parent | a8d4d4b9ff1076e0755fa357870845323ae6c4a7 (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.js | 5 |
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 { |