├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md └── w3c.json /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | All documentation, code and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/). 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Immersive Web Community Group 2 | 3 | This repository is being used for work in the W3C Immersive Web Community Group, governed by the [W3C Community License 4 | Agreement (CLA)](http://www.w3.org/community/about/agreements/cla/). To make substantive contributions, 5 | you must join the CG. 6 | 7 | If you are not the sole contributor to a contribution (pull request), please identify all 8 | contributors in the pull request comment. 9 | 10 | To add a contributor (other than yourself, that's automatic), mark them one per line as follows: 11 | 12 | ``` 13 | +@github_username 14 | ``` 15 | 16 | If you added a contributor by mistake, you can remove them in a comment with: 17 | 18 | ``` 19 | -@github_username 20 | ``` 21 | 22 | If you are making a pull request on behalf of someone else but you had no part in designing the 23 | feature, you can remove yourself with the above syntax. 24 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | All Reports in this Repository are licensed by Contributors 2 | under the 3 | [W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). 4 | 5 | Contributions to Specifications are made under the 6 | [W3C CLA](https://www.w3.org/community/about/agreements/cla/). 7 | 8 | Contributions to Test Suites are made under the 9 | [W3C 3-clause BSD License](https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html) 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UA initiated immersive sessions 2 | 3 | ## Motivation 4 | 5 | Current workflow to [request a WebXR session](https://www.w3.org/TR/webxr/#dom-xr-requestsession) requires user gesture activation. 2D pages usually provide a button that users click or tap to allow immersive mode, preventing pages to take over the display inadvertently without user's permission. 6 | 7 | Some scenarios like in-vr navigation require pages to enter immersive mode immediately without loading a 2D page first. UAs need an aditional standard mechanism to explicitly grant immersive sessions. Browsers will have the resposibility to inform the user and ask for appropriate permissions outside of the context of a 2D page. 8 | 9 | ## Design Goals 10 | 11 | The goal of this repository is to discuss and design a simple API for UAs to explicitly grant immersive sessions. 12 | 13 | ## Non Goals 14 | 15 | Define how a Virtual Reality or Augmented Reality browser would work [in alignment with the WebXR spec](https://github.com/immersive-web/webxr/blob/master/explainer.md#non-goals) 16 | 17 | While this discussion may make recommendations or define requirements for required behavior for informing users about targeted URLs for navigation, for example, the actual behavior and mechanism a browser should implement is not a goal of this proposal. 18 | 19 | ## User Scenarios 20 | 21 | 1. Immersive navigation, allowing UAs to implement seamless transitions between interlinked VR and AR content. Use cases include: 22 | 23 | - Games that contains links to other games. Or links to friends' games. 24 | - Personal blogs that link to affiliated VR sites or your friends blogs. 25 | - Educational websites for a class, that link to the school's portal or other resources. 26 | - User generated content linking to one another. Like Rec Room, VR Chat or Super Craft. 27 | - Sponsored links. You have a VR world about photography and filmmaking that links to Photorama, B&H, GoPro's VR portals. 28 | - Content portals in general (directories of games, immersive videos, collections). 29 | - Personal storefronts that link to products hosted by eBay VR, Amazon VR. One could also easily incorporate product 3D models hosted externally in services the like of Sketchfab or Google Blocks. 30 | 31 | 2. In an AR browser, a page will display virtual objects in physical context. Sites present 3D content immediately at load time without going through a 2D page workflow first. 32 | 33 | 3. Open in immersive mode. 2D windowed browsers might offer a way to open a link directly immersive mode, similar to "open in new tab" or "open in new window" actions offered today. This and other UA approaches could automatically grant permission to create an immersive session. 34 | 35 | 4. Kiosk mode. In public spaces like museums or trade shows one could setup an URL as `virtual homescreen`: A page that loads and enters immersive mode automatically when the browser starts. 36 | 37 | 5. Intents and deep linking. Native aplications might request a 38 | browser to open content directly in immersive mode. 39 | 40 | 6. [PWA](https://developers.google.com/web/progressive-web-apps/) An installed progressive WebXR app will enter immersive mode at launch. 41 | 42 | 7. Performance implications of single page applications. Having different web pages load is sort of beneficial for not having to deal with offloading / onloading new models and environments or making your own interstitial. You can avoid frame drops by letting the browser handle the transition, and VR web pages load quick enough. 43 | 44 | ## API Proposal 45 | 46 | UAs fire a `sessiongranted` event that allows content to enter immersive mode without user gesture activation: 47 | 48 | ``` 49 | navigator.xr.addEventListener('sessiongranted', function (evt) { 50 | // One could check for the type of session granted. 51 | // Events notifies of session creation after navigation, UA action, or requestSession. 52 | // The session object is provided as part of this event. 53 | if (evt.session.mode === 'immersive-vr') { 54 | // set up app state for immersive vr, if that's what the app wants 55 | } else { 56 | // notify user that this app only works in immersive vr mode, if desired 57 | } 58 | } 59 | ``` 60 | 61 | This is similar to the [WebVR displayactivate event](https://immersive-web.github.io/webvr/spec/1.1/#dom-window-onvrdisplayactivate) that popular libraries and frameworks incorporate alongide user gesture activated flows. The UA always remains in control on when immersive sessions are granted and can also revoke them. 62 | 63 | It is important that the new session starts the animation loop as soon as possible. Otherwise the compositor may end the immersive session. 64 | 65 | ## Security considerations 66 | 67 | In immersive mode the Browser UI may not be rendered and content controls all display real estate. The UA must steward users giving them information and control over displayed content at all times. 68 | 69 | Spoofing is a potential risk during immersive navitagion across origins. A malicious site could masquerade legitimate content, the browser UI or even the underling operating system interface without user noticing. Possible mitigaton mechanisms are: 70 | 71 | - Interstitial. When navigation occurs the UA can present the user a screen to evaluate the destination URL, an experience description and a button to continue or return to previous site. 72 | - Overlays. UAs control compositing and can always render information about the navigated page over content. 73 | - Modal dialog. User can invoke the browser UI at all times to interrupt or consult info about the current site. A modal interface (similar to Oculus or Steam home spaces) could be showed on demand with a reserved button or interaction that cannot be listened by content. To prevent spoofing, UAs could additionally display personal information that user can recognize and pages don't have access to (user generated doodles or environment choices) 74 | - Fall back to windowed mode. Some UAs might decide to retain a more traditional flow and always fallback to windowed / 2D mode on navigation. 75 | 76 | ## Developer and library maintainers considerations. 77 | 78 | The `sessiongranted` event is low friction and agnostic. It doesn't tie or prescribe a specific browser UX allowing experimentation and innovation in the space. Some browsers might decide to offer a traditional windowed workflow that falls back to 2D, others a more immersive experience. Content creators and library maintainers have to consider just two flows: User and UA initiated immersive sessions via user gesture and sessiongranted event respectively. 79 | 80 | ## Privacy considerations. 81 | 82 | ### Exposing State About the Client or Previous Page 83 | 84 | Varying the behavior based on client state (e.g., is the UA displaying multiple tabs) or the state of the previous page (e.g., whether the previous page had an active immersive session) leaks state about the user and user’s behavior that is not otherwise available to applications. 85 | 86 | This may be acceptable for same-origin transitions, since the application could have already known the state. However, this is not acceptable for cross-origin transitions, including history and background documents. 87 | 88 | ## Same-Origin vs. Cross-Origin Navigation 89 | 90 | For navigation scenarios (scenario #1), it may be relevant whether the target URL has the same origin as the existing page. Specifically, since the user has already interacted with the origin, it may be reasonable for implementations to be more permissive in such cases. UAs could navigate seamlessly on the same origin which reduces friction. 91 | Another benefit of same origin navigation is that resources might be cached already which will speed up the navigation. 92 | 93 | ## References 94 | 95 | https://github.com/immersive-web/webxr/blob/master/designdocs/navigation.md 96 | 97 | https://github.com/immersive-web/webxr/issues/517 98 | 99 | https://github.com/mrdoob/three.js/blob/dev/examples/js/vr/WebVR.js#L176 100 | 101 | https://github.com/aframevr/aframe/blob/master/src/utils/device.js#L6 102 | 103 | https://github.com/immersive-web/navigation/issues/1 104 | -------------------------------------------------------------------------------- /w3c.json: -------------------------------------------------------------------------------- 1 | { 2 | "group": [87846] 3 | , "contacts": ["dontcallmedom","himorin"] 4 | , "repo-type": "cg-report" 5 | } 6 | --------------------------------------------------------------------------------