Skip to content

Commit 0f24249

Browse files
keepkeyjonSaraVieira
authored andcommitted
Add allow="usb" to Preview iframe (codesandbox#2309)
Closes codesandbox#2304
1 parent 4c784a8 commit 0f24249

File tree

2 files changed

+2
-2
lines changed
  • packages

2 files changed

+2
-2
lines changed

packages/app/src/app/pages/common/Modals/ShareModal/getCode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const getEmbedUrl = (sandbox, mainModule, state) =>
6666
export const getIframeScript = (sandbox, mainModule, state) =>
6767
`<iframe src="${getEmbedUrl(sandbox, mainModule, state)}" title="${escapeHtml(
6868
getSandboxName(sandbox)
69-
)}" allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`;
69+
)}" allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`;
7070

7171
// eslint-disable-next-line
7272
export const getButtonMarkdown = (sandbox, mainModule, state) => {

packages/common/src/components/Preview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class BasePreview extends React.Component<Props, State> {
533533
<React.Fragment>
534534
<StyledFrame
535535
sandbox="allow-forms allow-scripts allow-same-origin allow-modals allow-popups allow-presentation"
536-
allow="geolocation; microphone; camera;midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media"
536+
allow="geolocation; microphone; camera;midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
537537
src={this.currentUrl()}
538538
ref={this.setIframeElement}
539539
title={getSandboxName(sandbox)}

0 commit comments

Comments
 (0)