-
Notifications
You must be signed in to change notification settings - Fork 190
feat: use blob src as default #80
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
base: main
Are you sure you want to change the base?
Conversation
Deploying mcp-ui with
|
Latest commit: |
37b588d
|
Status: | ✅ Deploy successful! |
Preview URL: | https://caee3775.mcp-ui.pages.dev |
Branch Preview URL: | https://feat-render-blob-instead-src.mcp-ui.pages.dev |
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.
Awesome! We may want to set a clearer name for the prop. Note that this is technically a breaking change
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.
Looks good (focused solely on blob logic part)
}, | ||
); | ||
} | ||
if (iframeSrcBlobUrl.current && typeof window?.URL?.revokeObjectURL === 'function') { |
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.
If you managed to create the blob since the create function existed, it necessarily translates to the revoke function existing as well, therefore check might be redundant (nit)
Cool idea here. Is there a limit within any given browser to how many characters a blob URL can be for an iframe src? I imagine it's possible for rawHTML to be huge if massive script bundles and large style blocks get inlined. Hopefully, this won't be the norm, but I am curious about the upper bound edge case (if one exists). |
See #76 - exposed raw HTML as
srcDoc
might be a security risk when used with other 3rd party scripts on the page.This PR changes the default from a raw HTML
srcDoc
to a Blob URL src.In embeding environments where CSP block Blob URLs - the
useSrcDoc
prop can be set to revert this behavior (and usesrcDoc
as before).