diff options
Diffstat (limited to 'bg/ResponseMetaData.js')
-rw-r--r-- | bg/ResponseMetaData.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/bg/ResponseMetaData.js b/bg/ResponseMetaData.js index 41d1fe9..5a75a3c 100644 --- a/bg/ResponseMetaData.js +++ b/bg/ResponseMetaData.js @@ -37,7 +37,6 @@ class ResponseMetaData { this.headers[propertyName] = h; } } - this.forcedUTF8 = false; } get charset() { @@ -52,21 +51,6 @@ class ResponseMetaData { return charset; } - get isUTF8() { - return /^utf-?8$/i.test(this.charset); - } - - forceUTF8() { - if (!(this.forcedUTF8 || this.isUTF8)) { - let h = this.headers.contentType; - if (h) { - h.value = h.value.replace(/;\s*charset\s*=.*|$/, "; charset=utf8"); - this.forcedUTF8 = true; - } // if the header doesn't exist the browser should default to UTF-8 anyway - } - return this.forcedUTF8; - } - createDecoder() { if (this.charset) { try { @@ -75,7 +59,7 @@ class ResponseMetaData { console.error(e); } } - return new TextDecoder("utf-8"); + return new TextDecoder("latin1"); } }; |