Skip to content

Miscellaneous small viewer clean-up #14566

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 2 commits into from
Feb 16, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Feb 14, 2022

  • Remove the typeof navigator-checks in the web/app_options.js file

    Given that the Navigator interface has been available since "forever", please see https://developer.mozilla.org/en-US/docs/Web/API/Navigator#browser_compatibility, it's somewhat difficult to see why these checks are actually necessary since the viewer is only intended for usage in browsers.

    Looking at the history of the code, this functionality was originally placed in the general src/shared/compatibility.js file which could thus run in e.g. worker-threads and Node.js environments (where the Navigator interface isn't available).

  • Change PasswordPrompt.close to an async method

    This is consistent with the open method, and it actually ever so slightly reduces the size of the file.

Given that the `Navigator` interface has been available since "forever", please see https://developer.mozilla.org/en-US/docs/Web/API/Navigator#browser_compatibility, it's somewhat difficult to see why these checks are actually necessary since the viewer is only intended for usage in browsers.

Looking at the history of the code, this functionality was originally placed in the general `src/shared/compatibility.js` file which could thus run in e.g. worker-threads and Node.js environments (where the `Navigator` interface isn't available).
This is consistent with the `open` method, and it actually *ever so slightly* reduces the size of the file.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

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/858e9a9371ed94a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/858e9a9371ed94a/output.txt

Total script time: 2.62 mins

Published

@timvandermeij timvandermeij merged commit d9a3a24 into mozilla:master Feb 16, 2022
@timvandermeij
Copy link
Contributor

Thank you for improving this!

@Snuffleupagus Snuffleupagus deleted the misc-viewer-cleanup branch February 17, 2022 12:51
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.

3 participants