Skip to content

JSON viewer: Open in SolidOS link that names the thing the document is about - #51

Merged
melvincarvalho merged 1 commit into
mainfrom
json-viewer-solidos-link
Nov 30, 2026
Merged

melvincarvalho merged 1 commit into
mainfrom
json-viewer-solidos-link

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #50.

Adds an "Open in SolidOS" link to the JSON viewer, beside the Viewer / Raw switch.

What changes

  • src/json-viewer-start.js: the viewer is started with solidosLink: true.
  • vendor/json-viewer/json-viewer.js: viewer 0.0.2 from solid-panes/json at 44c440e, with its SHA-256 in PINS.json (scripts/vendor-json-viewer.js updated to that commit). 0.0.2 adds the rule for what the link names.
  • README, PRIVACY and CHANGELOG (Unreleased) say what the link is.

What the link does

  • An ordinary link to https://solidos.org/docs/browser/?uri=<address> in a new tab. Nothing is requested unless it is clicked; the "no added requests" check in the browser test still passes.
  • For a JSON-LD document about one thing, it names that thing rather than the document: main entity in either direction (mainEntity / primaryTopic, mainEntityOfPage / isPrimaryTopicOf), else #me, else #this. Only things inside the same document; an identifier elsewhere is never followed. Example: …/people/alex.jsonld opens as …/people/alex.jsonld#me, so SolidOS shows the Profile pane.

What does not change

  • "View JSON pages" is still off by default; with it off the script is not registered.
  • No new permission, no storage, no version bump.

Checked

  • npm test 486 pass, npm run lint clean, npm run build.
  • Headless Chromium with the built extension: the existing 30 checks pass; the link's address on four sample pages is as described (alex.jsonld → #me; a multi-thing document and plain JSON → the document; an address with a fragment keeps it).
  • In the viewer's own repository: 29 cases for the rule, 68 browser checks.

One thing for the maintainers to weigh: the link is shown whenever the viewer is on. If you would rather it were its own setting, that is a small follow-up.

@melvincarvalho
melvincarvalho merged commit a68e1a3 into main Nov 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON viewer: an "Open in SolidOS" link that names the thing the document is about

1 participant