Skip to content

Commit 775fc4c

Browse files
cmsetzeralukach
andauthored
feat: Add full screen support for ObjectPreview iframes (#224)
## What I'm changing This change enables the ObjectPreview `iframe` element to launch full screen mode for viewers that request it, such as the image and 3D model viewers from #210. ## How I did it I've added the permissions policy `allow="fullscreen"` to the `iframe` in ObjectPreview. This enables any current or future viewer to launch full screen mode. An alternative approach would be to make `allow` a custom per-format attribute like `style`, but this seems simpler. ## How you can test it On a preview branch where this feature is active, navigate to the following pages and click the "Toggle full screen" button within the preview `iframe`: * https://source.coop/harvard-lil/smithsonian-open-access/media/nmnh/NMNH-00000406-000001.jpg * https://source.coop/harvard-lil/smithsonian-open-access/3d/009463d3-6f58-4f5b-8e60-915805a876ee/USNM_91201-150k-1024-low.glb Co-authored-by: Anthony Lukach <anthonylukach@gmail.com>
1 parent 106c834 commit 775fc4c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/features/products/object-browser/ObjectPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function ObjectPreview({ sourceUrl: cloudUri }: ObjectPreviewProps) {
6464
const { src, style } = iframeProps;
6565
return (
6666
<Box mt="4" pt="4" style={{ borderTop: "1px solid var(--gray-6)" }}>
67-
<iframe width="100%" height="600px" style={style} src={src}>
67+
<iframe width="100%" height="600px" allow="fullscreen" style={style} src={src}>
6868
Your browser does not support iframes.
6969
</iframe>
7070
</Box>

0 commit comments

Comments
 (0)