diff --git a/package.json b/package.json index c31a74c..86791a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "id": "jsonview@brh.numbera.com", - "version": "2.4.0", + "version": "2.4.1", "name": "jsonview", "title": "JSONView", "description": "View JSON documents in the browser.", diff --git a/src/background.ts b/src/background.ts index 33aa4c3..d65b6be 100644 --- a/src/background.ts +++ b/src/background.ts @@ -27,17 +27,15 @@ function transformResponseToJSON(details: chrome.webRequest.WebResponseHeadersDe const dec = new TextDecoder("utf-8"); const enc = new TextEncoder(); - - filter.onstart = (_event) => { - filter.write(enc.encode("
")); - }; + let content = ""; filter.ondata = (event) => { - filter.write(enc.encode(dec.decode(event.data))); + content = content + dec.decode(event.data); }; filter.onstop = (_event: Event) => { - filter.write(enc.encode("")); + const outputDoc = `
${content}`; + filter.write(enc.encode(outputDoc)); filter.disconnect(); }; }