Skip to content

Conversation

@mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Oct 22, 2025

Improve support and documentation for embedding marimo notebooks in sandboxed iframes, and adds runtime detection of iframe capabilities to the frontend (with improved warnings and fallbacks).

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Oct 22, 2025 5:43pm

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 22, 2025
@mscolnick mscolnick requested a review from dmadisetti October 22, 2025 17:39
cursor[bot]

This comment was marked as outdated.

There are various ways to embed marimo notebooks in other web pages, such
There are various ways to embed marimo notebooks in other web pages, such
as web documentation, educational platforms, or static sites in general. Here
are two ways:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classic off-by-one error

<iframe
src="https://marimo.app/your-notebook"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webcam too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed for our components


**Permission Policy:**

* **`allow="microphone"`**: Required for `mo.ui.microphone()` widget functionality
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ok. We could add mo.ui.webcam at some point. But probably with demand

function detectIframeCapabilities(): IframeCapabilities {
const isEmbedded = window.parent !== window;

const capabilities: IframeCapabilities = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised there isn't a more native way. Not much of a penalty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not at all

@mscolnick mscolnick merged commit 755a865 into main Oct 22, 2025
27 checks passed
@mscolnick mscolnick deleted the ms/sandbox-iframes branch October 22, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants