codehike
codehike copied to clipboard
Permissions on preset Iframe
Hi,
Is there a way to add permissions to the preset iframe? Like the example from codesandbox:
<iframe
src="https://codesandbox.io/embed/new?codemirror=1"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
If not, would you be open to a PR?
Amazing library btw!
FYI - Sandpack added the allow attribute to their iframe a week ago but they have an open issue where it doesnt work:
Sandpack preview's iframe is not setting allow with domain
They fixed the issue but didnt publish a new version yet. I tested with latest main - they seem to have an error with the latest bundler (1.20.6) but if you change it to 1.20.1 it works correctly and asks for permissions.
Just FYI i guess