You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: explainer.md
+24
Original file line number
Diff line number
Diff line change
@@ -936,6 +936,29 @@ function drawScene() {
936
936
}
937
937
```
938
938
939
+
### Immersive Nagivation
940
+
941
+
There are several scenarios in which a user may want to navigate to a page in such a way that it immediately begins displaying immersive WebXR content. This is known as "Immersive Navigation". Some potential cases that may trigger immersive navigation are:
942
+
943
+
* Navigating from within an immersive WebXR session with the `window.location` attribute or `window.history` API.
944
+
* Opening a page from a shortcut that has been added to a homescreen, bookmarks, or other "deep link" context.
945
+
* Opened within a native app.
946
+
947
+
It's up to the UA which immersive navigation scenarios it will support (although there are security and privacy considerations that all UAs should take into account, see below.) As a result, pages should never exclusively rely on immersive navigation as their only method for displaying immersive content. For a far more thorough look at the criteria that should be examined for determining when immersive navigation is appropriate and other considerations surrounding it, see the [Navigation Explainer](https://github.com/immersive-web/webxr/pull/382).
948
+
949
+
A page enables immersive navigation by calling `requestImmersiveNavigationSession` on the `navigator.xr` object. This call is passed an `XRSessionCreationOptions` dictionary like `XRDevice`'s `requestSession` function, but the `immersive` option is ignored, since "immersive navigation" implies that the receiving session must be immersive. This call must be made prior to the `window`'s `load` event has completed, or the promise will reject immediately. Additionally if the page is not eligible for immersive navigation or the `XRSessionCreationOptions` specified are not compatible with the session navigated from the promise will also reject.
950
+
951
+
```js
952
+
window.addEventListener('load', () => {
953
+
// { immersive: true } is implicit in this call, because navigations between
954
+
// immersive sessions is the only context in which this makes sense.
0 commit comments