Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature detection of requestFullscreen() extensions would be possible #6

Open
foolip opened this issue Jan 18, 2024 · 1 comment
Open

Comments

@foolip
Copy link

foolip commented Jan 18, 2024

The explainer says:

Does not allow developers to detect the Locked Mode feature by checking the existence of a separate API

Although complex, feature detection is possible if we're considering new dictionary members. Example using navigationUI:

let supported = false;
document.createElement('div').requestFullscreen({
  get navigationUI() { supported = true; }
}).catch(() => {});
console.log(supported);

This will make its way through bindings and access navigationUI of the options object passed in, but the request will be rejected and do nothing because the element isn't attached.

@foolip
Copy link
Author

foolip commented Jan 18, 2024

It is still absolutely true that detecting a new method is much easier and less of a headscratcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant