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

WebKit deprecated request in favour of enter #160

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/screenfull.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* screenfull
* v5.0.0 - 2019-09-09
* v5.0.0 - 2019-10-24
* (c) Sindre Sorhus; MIT License
*/
(function () {
Expand All @@ -23,7 +23,7 @@
],
// New WebKit
[
'webkitRequestFullscreen',
'webkitEnterFullscreen',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as the webkitEnterFullscreen only present in the HTMLVideoElement object, not in the document. There should be a way to check whether video object has ability to enter fullscreen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye you're right @RusinovAnton, not sure how I missed that. It seems like you can't request fullscreen on the document in Safari? I just tried and nothing worked. Has it always been like this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find actual info on that. I can see that there is no webkitEnterFullscreen property on document object in Safari. However. there is a document.documentElement.webkitRequestFullscreen which seems like not working for me. I've tried to find maybe there are some feature flags I can enable, but couldn't find any.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh-oh, it actually works if its triggered not from the console but from the user input even, like button click! -

button.addEventListener('click', ()=> document.documentElement.webkitRequestFullscreen())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no document.documentElement.webkitEnterFullscreen property, tho

and the doc on it is pretty much empty :(

https://developer.apple.com/documentation/tvmljs/document/1630671-documentelement

'webkitExitFullscreen',
'webkitFullscreenElement',
'webkitFullscreenEnabled',
Expand All @@ -33,7 +33,7 @@
],
// Old WebKit
[
'webkitRequestFullScreen',
'webkitEnterFullScreen',
'webkitCancelFullScreen',
'webkitCurrentFullScreenElement',
'webkitCancelFullScreen',
Expand Down
4 changes: 2 additions & 2 deletions dist/screenfull.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/screenfull.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
// New WebKit
[
'webkitRequestFullscreen',
'webkitEnterFullscreen',
'webkitExitFullscreen',
'webkitFullscreenElement',
'webkitFullscreenEnabled',
Expand All @@ -28,7 +28,7 @@
],
// Old WebKit
[
'webkitRequestFullScreen',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to leave the old one for older browsers to happen?

'webkitEnterFullScreen',
'webkitCancelFullScreen',
'webkitCurrentFullScreenElement',
'webkitCancelFullScreen',
Expand Down