Skip to content

webR App: Load and update encoded share URLs #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 7, 2025
Merged

webR App: Load and update encoded share URLs #554

merged 15 commits into from
Jul 7, 2025

Conversation

georgestagg
Copy link
Member

@georgestagg georgestagg commented Jul 1, 2025

Sets the URL hash to #code=[...] as file content in the webR App is opened or saved.

Currently, only files open in an editor tab are encoded into the URL.

If the sharing code already exists in the URL on first page load, it is decoded and the files are written to the VFS as well as opened in the editor.

File contents are encoded using msgpack and zlib compressed using Pako, since both of these libraries are already used elsewhere.

A message handler is also added to the webR application allowing for populating file content via embedding and postMessage to iframe.

Examples are given in src/examples/embed.

Closes #356.

@georgestagg georgestagg merged commit 88c3fb8 into main Jul 7, 2025
4 checks passed
@georgestagg georgestagg deleted the share-url branch July 7, 2025 15:48
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.

Consider adding "Share" feature to webR REPL
1 participant