Screen rendering issue when opening a new tab from a WebXR session
See original GitHub issueDescription
On Android Chrome, while in a WebXR session, opening a link to a new tab using window.open
causes a screen rendering problem, displaying a partial snapshot of the originating ModelViewer page rather than navigating to the destination page.
It appears that this partial snapshot is actually layered over the destination page/tab.
The issue is only observed when window.open
is targeted to a new tab, using a name
parameter of: _blank
, a custom name, or omitted entirely.
The issue is not observed when using a name
parameter of: _parent
, _self
, or _top
.
Workarounds:
-
Before using
window.open
, first dispatch aclick
to ModelViewer’s default exit button slot, EG:modelViewer.shadowRoot.querySelector('#default-exit-webxr-ar-button').click();
-
Or, target
window.open
to the current tab using:_parent
,_self
, or_top
.
Live Demo
https://modelviewer-webxr-exitlinks.glitch.me/
Steps to reproduce:
- Visit the demo link
- Enter a WebXR AR session
- Once in WebXR, click one of the buttons labeled: ‘Open’, ‘Open _blank’, or ‘Open earth’.
- Observe what appears to be a broken ModelViewer page. Try to interact. You can’t.
- Swipe screen to go back in browser history.
- The intended destination page will now be revealed.
- Observe that this is in a new tab, and the original ModelViewer page is in another tab.
Version
- model-viewer: v1.7.2
Browser Affected
- Chrome, version: 91.0.4472.120
- Edge
- Firefox
- IE
- Safari
OS
- Android 11, Pixel 4 XL
- iOS
- Linux
- MacOS
- Windows
AR
- WebXR
- SceneViewer
- QuickLook
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Tracking internally as https://crbug.com/1234085.
@klausw - Retesting in Chrome stable (92.0.4515.159) and the above issue is no longer seen. New tabs open as expected. Works great. Thanks for the fix!