Skip to content

Commit e9a65d7

Browse files
committed
Undo bad streaming
1 parent 95d460e commit e9a65d7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## JSONView 2.4.1
2+
3+
- Fix mangled arrows
4+
15
## JSONView 2.4.0
26

37
- Preserve indentation when copying JSON.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"name": "jsonview",
55
"title": "JSONView",
66
"description": "View JSON documents in the browser.",

src/background.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@ function transformResponseToJSON(details: chrome.webRequest.WebResponseHeadersDe
2727

2828
const dec = new TextDecoder("utf-8");
2929
const enc = new TextEncoder();
30-
31-
filter.onstart = (_event) => {
32-
filter.write(enc.encode("<!DOCTYPE html><html><body><pre>"));
33-
};
30+
let content = "";
3431

3532
filter.ondata = (event) => {
36-
filter.write(enc.encode(dec.decode(event.data)));
33+
content = content + dec.decode(event.data);
3734
};
3835

3936
filter.onstop = (_event: Event) => {
40-
filter.write(enc.encode("</pre></body></html>"));
37+
const outputDoc = `<!DOCTYPE html><html><body><pre>${content}</pre></body></html>`;
38+
filter.write(enc.encode(outputDoc));
4139
filter.disconnect();
4240
};
4341
}

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "JSONView",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"description": "__MSG_extensionDescription__",
66
"author": "Benjamin Hollis",
77
"homepage_url": "https://jsonview.com/",

0 commit comments

Comments
 (0)