diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed16e8..ce72e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## JSONView 2.4.2 + +- Fix mangled encoding in Firefox + ## JSONView 2.4.1 - Fix mangled arrows diff --git a/package.json b/package.json index 86791a7..88bc97a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "id": "jsonview@brh.numbera.com", - "version": "2.4.1", + "version": "2.4.2", "name": "jsonview", "title": "JSONView", "description": "View JSON documents in the browser.", diff --git a/src/background.ts b/src/background.ts index d65b6be..fa35a6a 100644 --- a/src/background.ts +++ b/src/background.ts @@ -30,11 +30,12 @@ function transformResponseToJSON(details: chrome.webRequest.WebResponseHeadersDe let content = ""; filter.ondata = (event) => { - content = content + dec.decode(event.data); + content += dec.decode(event.data, { stream: true }); }; filter.onstop = (_event: Event) => { - const outputDoc = `
${content}`; + content += dec.decode(); + const outputDoc = `
${content}`; filter.write(enc.encode(outputDoc)); filter.disconnect(); }; diff --git a/src/manifest.json b/src/manifest.json index 82a5d58..7e4ec24 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "JSONView", - "version": "2.4.1", + "version": "2.4.2", "description": "__MSG_extensionDescription__", "author": "Benjamin Hollis", "homepage_url": "https://jsonview.com/",