Skip to content

Prevent "Prefixed Fullscreen API is deprecated." warnings in the MOZCENTRAL version (issue 7270) #7273

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

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

We're already, since quite some time, using the standard Fullscreen API provided that it's available in the browser. The warning is only caused by the code that checks if the Fullscreen API is supported.

This patch uses a simple preprocessor tag to avoid the warning, since I'm assuming that in general, we want to try and remain backwards compatible with the prefixed versions of the Fullscreen API.

Fixes #7270.

@@ -419,10 +419,14 @@ var PDFViewerApplication = {
var support = !!(doc.requestFullscreen || doc.mozRequestFullScreen ||
doc.webkitRequestFullScreen || doc.msRequestFullscreen);

//#if MOZCENTRAL
Copy link
Contributor

@yurydelendik yurydelendik Apr 29, 2016

Choose a reason for hiding this comment

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

I'm thinking we can include the check above it the #if too. Can you make MOZCENTRAL section as var support = document.fullscreenEnabled === true;.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just so I understand, do you want to get rid of the !!doc.requestFullscreen part, or did you mean something like the following?

//#if MOZCENTRAL
//  var support = !!doc.requestFullscreen && document.fullscreenEnabled === true;
//#else
  ...
//#endif

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, doc.requestFullscreen will present anyway, also document.fullscreenEnabled === true will make sure it's enabled and at the same moment will check if API is present (=== true) is a key :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good, it's fixed now.

…ENTRAL version (issue 7270)

We're already, since quite some time, using the standard Fullscreen API provided that it's available in the browser. The warning is only caused by the code that checks if the Fullscreen API is supported.

This patch uses a simple preprocessor tag to avoid the warning, since I'm assuming that in general, we want to try and remain backwards compatible with the prefixed versions of the Fullscreen API.

Fixes 7270.
@yurydelendik
Copy link
Contributor

Thank you for the patch.

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

Successfully merging this pull request may close these issues.

Use unprefixed fullscreen API on Firefox
2 participants