discoveryjs / browser-extension-json-discovery

A browser extension (Chrome, Edge, Firefox) that changes the way you're viewing JSON
305 stars 11 forks source link

JSON is not parsed successfully when downloading from some servers #82

Closed lahmatiy closed 2 years ago

lahmatiy commented 2 years ago

Based on https://github.com/discoveryjs/discovery/issues/48

JsonDiscovery reads JSON from text nodes of a document (since there is no any other way to get a loading content). Our assumption was that a browser never changes a nodeValue of added text nodes on loading. As we found, that's not always true. In some conditions, like slow servers, a browser can append a new content to existing text node instead of creating a new one. As a result JsonDiscovery skips some part of content and fails with a parse error. This problem was hard to investigate since hard to reproduce a conditions. Since the root cause is clear now, a fix is coming.