google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.69k stars 798 forks source link

fix DPR for iframes #4723

Closed elalish closed 3 months ago

elalish commented 3 months ago

Turns out any <model-viewer> embedded in an <iframe> gets the capped DPR=1 (no high-res render) unless the iframe has a meta viewport tag in its own <head>. That's a bit weird, since meta viewport tags are ignored in iframes and only the top-level document counts. As such, we'll assume the top level document has a meta viewport tag (as that's more common) when the element is inside an iframe and can't query its parent's <head>.