Skip to content

Commit

Permalink
fix DPR for iframes (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Mar 22, 2024
1 parent 8e9fe53 commit 5c23a13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/model-viewer/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ export const resolveDpr: () => number = (() => {
return true;
}

if (window.self !== window.top) {
// iframes can't detect the meta viewport tag, so assume the top-level
// page has one.
return true;
}

const metas = document.head != null ?
Array.from(document.head.querySelectorAll('meta')) :
[];
Expand Down

0 comments on commit 5c23a13

Please sign in to comment.