Skip to content

Commit ac5fcfd

Browse files
authored
Dashboard v2: preview iframes: disable autoplay + remove scrollbars (#103704)
1 parent 989f420 commit ac5fcfd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/dashboard/sites/site-preview/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export default function SitePreview( {
1818
const secureUrl = url.replace( /^http:\/\//, 'https://' );
1919
return (
2020
<iframe
21+
// Enabling sandbox disables most features, such as autoplay,
22+
// alerts, popups, fullscreen, etc.
23+
sandbox="allow-scripts allow-same-origin"
24+
// Officially deprecated, but still widely supported. Hides
25+
// scrollbars in case they are set to always visible.
26+
scrolling="no"
2127
loading="lazy"
2228
// @ts-expect-error For some reason there's no inert type.
2329
inert="true"

0 commit comments

Comments
 (0)