fix: allow for data-uris in mpl-interactive and marimo-panel after a cell has run#9196
Merged
fix: allow for data-uris in mpl-interactive and marimo-panel after a cell has run#9196
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend trusted-URL validation used by plugins (e.g., mpl-interactive, Panel) so that, in environments without backend virtual-file serving (WASM/VS Code), base64 data: URLs can be treated as trusted only after the user has run at least one cell (matching the same “user has executed code” trust signal used for HTML sanitization behavior).
Changes:
- Extend
isTrustedVirtualFileUrlto accept specific base64data:URLs (JS/CSS) gated onhasRunAnyCellAtom. - Add Vitest coverage for the new data-URL behavior (accepted after a cell run; rejected otherwise and for unsafe types/forms).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/plugins/core/trusted-url.ts | Adds gated support for safe base64 data: URLs in trusted virtual-file URL checks. |
| frontend/src/plugins/core/test/trusted-url.test.ts | Adds tests verifying data-URL acceptance/rejection depending on whether any cell has run. |
manzt
approved these changes
Apr 16, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.2-dev40 |
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.2 (marimo-team/marimo#9196) re-allows plugins to load base64 `data:` URIs, but only once `hasRunAnyCellAtom` is `true`,and that atom only flips inside marimo's `useRunCells` hook, which our renderer never calls (cells run through VS Code's NotebookController). Seed it at `initialize()` so holoviews/bokeh and anywidget-backed outputs like polars tables stop failing with "Refusing to load … from untrusted URL". Workspace trust and extension ownership of the kernel are used as the signal the atom is standing in for.
manzt
added a commit
to marimo-team/marimo-lsp
that referenced
this pull request
Apr 21, 2026
Fixes #490 marimo 0.23.1 renamed the Panel plugin's `extension` field to `extensionUrl` and started rejecting the `data:` URI fallback that VS Code's kernel relies on (`virtual_files_supported=False`), breaking holoviews/bokeh with "Invalid input: expected string, received undefined". 0.23.2 re-allows `data:` URIs (marimo-team/marimo#9196); the dependency bump picks up the new schema. Raise the compatibility floor since both halves are needed.
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.
This PR updates the logic for trusting virtual file URLs in marimo plugins, allowing data uri after some cell has been run that use inline base64 data URLs (WASM and VS Code runtimes)