- 
                Notifications
    You must be signed in to change notification settings 
- Fork 748
improvement: fallbacks and warnings for missing features from sandboxed iframes + docs #6883
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
Conversation
…ed iframes + docs
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
| 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: | 
There was a problem hiding this comment.
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" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webcam too?
There was a problem hiding this comment.
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 | 
There was a problem hiding this comment.
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 = { | 
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at all
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).