Closed toji closed 4 years ago
LGTM FWIW
Likely when does Chrome Canary switch from .supportsSession()
to .isSessionSupported()
? Until it does the user code may need to be aware of the polyfill like
if (navigator.xr.isSessionSupported) {
...
} else if (navigator.xr.supportsSession) {
...
}
Chrome canary should already have the new method, but we're also keeping the old function around for a little while with a console message warning developers that it's been deprecated and what they should replace it with.
Thanks for the comment! That sounds nice.
Posted in anticipation of https://github.com/immersive-web/webxr/pull/841 landing. I'll take this out of draft once that happens.
Changes
navigator.xr.supportsSession()
tonavigator.xr.isSessionSupported()
and made the method resolve with a boolean to indicate success or failure. This matches the spec change made to do the same in response to feedback from the TAG.This PR also introduces a small shim that assists developers using the previous signature by redirecting the call to the right place and outputting a warning to the console informing them of the new method name and behavior. That can eventually be removed once the API has been out for a bit.