-
Notifications
You must be signed in to change notification settings - Fork 401
Description
We've previously talked about the need to have a way of doing basic feature detection before creating a session. This is needed because it's a poor user experience to launch into an immersive session, which may involve user-visible transitions and setup steps, only to be immediately told "Oops! Sorry, you can't actually do this." We must balance the desire to avoid that type of user inconvenience, however, with the need to suppress as much fingerprintable information as possible prior to session creation.
The proposed solution so far is to allow the user to pass in a set of "required features" when requesting the session. That way the UA can, prior to performing any user-visible actions, opaquely determine if the requirements can be met and reject early if not. Functionally, this would mean that sites with hard requirements beyond "Do you support AR or VR?" would still add a button to enter immersive mode to their page but upon clicking it the users could ~immediately be presented with a dialog from the page stating "Your system doesn't meet the requirements for this experience."
This can be done in a privacy sensitive way because:
- Immersive session creation requires user activation, so features cannot be checked prior to user interaction.
- The session rejection should NOT state which features of the list were not available, making it difficult to determine what was missing in a list of more than one requirement.
- Because of the user activation requirement, session requests cannot be rapidly spammed with different combinations of features to eventually see what works and what doesn't.
- The consequences of a successful request are high, in that it will incur user-visible side effects, and thus developers cannot do a "silent" feature check.
We've also discussed in the past that we want to encourage developers to be as responsive as possible to different systems with XR content, and this feature would seem to discourage that in favor of allowing developers to easily block off content to all but a small set of users, but I believe that it has some built-in deterrents:
- The user experience for getting rejected when you click an "Enter XR" button, while better than if it started incurring full screen transitions and the like, is still relatively poor. Nobody likes to be teased with a feature and then told "Nope! Not for you!" As such, developers are likely to only use this as a gate if they know their experience simply cannot work without a given feature.
- We can control the list of features that can be tested for, so let's maybe not add a
requiresOculusRift
enum, yeah?
This general concept has already been introduced in limited form to the spatial tracking explainer with the requiredFrameOfReferenceType
dictionary argument. #417 is also highly related. I feel, however, like it should be handled using a more generic mechanism so that any type of requirement we deem necessary in the future (for example: Presence of 6DoF input?) can be tested the same way.
My suggestion is that we have developers pass in an array of requirements (given as enums) to requestSession
, like so:
requestSession({
mode: 'immersive-ar',
requiredFeatures: ['x-ray-vision', 'levitation']
}).then(/* ... */);
(Example features are intentionally stupid so that nobody thinks I'm proposing anything.)
The benefit to this approach, rather than listing required features with a dictionary, is that there's no mechanism in Javascript to fail if an invalid dictionary entry is passed. (This is a feature, not a bug.) We can, however, enumerate over every entry in an array and reject if any individual item is unsupported or unrecognized. That means that even UAs that haven't been updated to recognize a specific feature can still reliably reject when it's listed as required.