The view in your space button doesn't seem to work inside an iframe on iOS Chrome or Firefox #4728
Replies: 5 comments 1 reply
-
I don't believe Firefox launches Quick Look at all. I don't think I've tried iOS Chrome AR inside of an iframe either. I'd recommend making some simple Glitches (feel free to share them here!) to try different permutations. We'd love to know what you find, and we may be able to get an iOS Chrome bug fixed if there's a clear repro. |
Beta Was this translation helpful? Give feedback.
-
From my experience, opening AR QuickLook from ModelViewer in iFrame is possible in iOS Safari, iOS Chrome and iOS Firefox (yup, even Firefox). Check out this demo: You can turn on/off Auto USDZ and a range of QuickLook parameters. Try it in and out of the iFrame. With iOS 17.4.1:
So there may be some other issue at play. Possibly a cross origin issue.
|
Beta Was this translation helpful? Give feedback.
-
I reproduced the issue again just now with an iPhone 13 running iOS 17.4.1. The version of Chrome I have installed is 123.0.6312.52. This is the url I'm using to get the model-viewer code: https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js I made some glitches to demonstrate the issue. This first one has the model viewer. It is able to open the usdz just fine on iOS Chrome. This one has an iframe pointing to the previous glitch: When I click the view in your space button in the second glitch the iframe goes blank and quicklook is never engaged I did discover that if the usdz is served from glitch's cdn it works. In the glitch I created, the usdz is sourced from https://developer.apple.com/augmented-reality/quick-look/models/nike-air-force/sneaker_airforce.usdz I'm not an expert on iframes so correct me if I'm wrong but I feel like if quicklook can open the usdz from the top context it should also be able to open it from an iframe. The url to the usdz has not changed. At the very least the iframe shouldn't be wiped. |
Beta Was this translation helpful? Give feedback.
-
@viperphase1 - I can see from your example, the USDZ file from developer.apple.com domain, has the HTTP header of This specifically prevents the USDZ file from being loaded into an iFrame on another domain. This means the iFrame content and all the iFrame ancestors (the parent pages) must be on the same domain as the USDZ. It just so happens, iOS Safari is yet to fully implement X-Frame-Options support. So your cross-domain iFrame example works in Safari. Chrome and Firefox both respect X-Frame-Options, so are preventing the loading of the USDZ file. So I would check where your actual USDZ files are being served from and make sure that HTTP X-Frame-Options is not configured to More info on X-Frame-Options here: |
Beta Was this translation helpful? Give feedback.
-
One solution is to add target="_top" to the quicklook anchor tag. That works even with a cross domain usdz url. |
Beta Was this translation helpful? Give feedback.
-
I have a page with the model-viewer and attempted to embed it in a website with an iframe. It has been brought to my attention that quicklook fails to launch from within an iframe when viewing the site on iOS Chrome or Firefox (could be a problem in other non-safari browsers too). I already looked at #3626. I'm certain this a different issue.
Instead of launching quicklook I get a failed request for the usdz file: "Refused to display {url_to_usdz} in a frame because it set 'X-Frame-Options' to...
My best guess is that the anchor tag that is supposed to trigger quicklook is instead triggering a navigation on the iframe. As in the iframe src changes to the usdz url.
I imagine this is something for Apple to fix but I wanted to make sure the model-viewer community is aware of this. Beyond alerting the community I'm also reaching out for advice if anyone knows a workaround or a fix. Additional details about the problem would also be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions