Repository navigation
View JSON pages: bundle the JSON / JSON-LD viewer, off by default - #49
Merged
Merged
Conversation
The viewer is one vendored file from solid-panes/extension, pinned in vendor/json-viewer/PINS.json. Its content script is registered only while the setting is on, in src/content-scripts.js beside the other three, so a switched-off site leaves it out too. No new permission, no web-accessible resource, no storage access from the page side, no network requests. The full SolidOS panes viewer is separate and not part of this.
…s kept in the popup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48.
Adds a setting, View JSON pages, to the popup. Off by default. When on, a page that is a JSON, JSON-LD or JSON Lines response is shown as a collapsible tree with a table view, search, type badges and followable
@idlinks, and a Viewer / Raw switch.How it is built in
vendor/json-viewer/json-viewer.jscomes from solid-panes/json at a pinned commit, recorded with its SHA-256 inPINS.json;scripts/vendor-json-viewer.jsrefreshes it and a test checks the tree against the pin, the same way asvendor/sidestr/.src/content-scripts.jsgains one optional script,podkey-json-viewer, beside the three existing ones. With the setting off it is unregistered, so the viewer's code runs on no page. A site Podkey is switched off for leaves it out like the others.src/json-viewer-start.js) touches neitherchrome.runtimenor the bridge. It leaves the isolated world'sfetchand other globals alone and adds one name,SolidJsonViewer.Checked
npm test: 483 pass (16 new),npm run lintclean,npm run buildruns.window.nostrstill present; no added requests); off again (script removed, pages untouched); the popup shows the toggle unchecked. 30 of 30.Not in this pull request
store/SUBMISSION.mdis unchanged. It describes Podkey as a key signer with "no bundled unrelated features". If this is merged, that text and the store listing need a decision before the next store submission (see Bundle the JSON / JSON-LD viewer (off by default) #48).To consider in review
All of an extension's content scripts share one isolated world per page, so while the setting is on the viewer runs beside the bridge. It parses untrusted page text. The mitigations here are: off by default, unregistered when off, nothing on non-JSON pages, no extension API in the viewer, and tests that fail if the vendored file gains
chrome., a dynamic import,evalor afetchreplacement.