Add Share-as-URL: encode inspection results into a static link#18
Open
DmitriyAlergant wants to merge 2 commits into
Open
Add Share-as-URL: encode inspection results into a static link#18DmitriyAlergant wants to merge 2 commits into
DmitriyAlergant wants to merge 2 commits into
Conversation
Encodes the extracted clipboard data (with file blobs inlined as data URLs) into a gzipped base64url payload stored in location.hash. On page load, if the hash is present, the saved inspection is rendered directly. No backend. Motivation: users want to share raw clipboard contents when reporting pasting-related issues to maintainers of software they use.
The recipient of a Share-as-URL link can now write the inspected payload back into their own clipboard. Reconstructs a multi-type ClipboardItem from .types / .items / .files (including data:-URL blobs from inlined files) and writes via navigator.clipboard.write. Falls back to a reduced set (text/plain, text/html, image/png) if the browser rejects custom MIME types, and to writeText() as a last resort. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5663076 to
6ce8f9b
Compare
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.
Adds a "Share as URL" button that encodes the current inspection into a gzipped base64url payload stored in
location.hash. Opening that URL re-renders the same inspection. No backend.Also allows recepients to copy the shared contents back into their clipboard.
Why: for users that need to share raw clipboard contents when reporting clipboard-related issues to maintainers of software they use.
Notes
CompressionStream('gzip')/DecompressionStream(modern browsers).index.jswas intentionally left out of this PR to keep the diff readable; pleasenpm run buildbefore deploying.