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

Simplify handling of requestFullscreen errors in PDFPresentationMode #14765

Merged
merged 2 commits into from
Apr 10, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Since quite some time the `Element.requestFullscreen()` method has been returning a Promise, see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#return_value
Hence we can utilize that to detect failures to enter fullscreen-mode, and remove our old `setTimeout`-based hacks that were used for this purpose.

According to the MDN compatibility data, see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#browser_compatibility, all browsers that we support have implemented this functionality. (Note that after PR 14606, we no longer support PresentationMode in Safari.)
…PresentationModeState`

With the changes in the previous patch, we can simplify the state-tracking by using the `PresentationModeState`-values directly in the `PDFPresentationMode` class.
@Snuffleupagus Snuffleupagus changed the title Request fullscreen promise Simplify handling of requestFullscreen errors in PDFPresentationMode Apr 9, 2022
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 9, 2022

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/7d1d5686f02fd15/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 9, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/7d1d5686f02fd15/output.txt

Total script time: 2.63 mins

Published

@timvandermeij timvandermeij merged commit 8f26e70 into mozilla:master Apr 10, 2022
@timvandermeij
Copy link
Contributor

Much better; thanks!

@Snuffleupagus Snuffleupagus deleted the requestFullscreen-Promise branch April 10, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants