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

Improve the PDFViewerApplication._contentLength handling in the viewer, related mostly to scripting #12822

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

Ensure that PDFViewerApplication._contentLength is always updated with the correct length, as returned by PDFDocumentProxy.getDownloadInfo, and only let the PDFViewerApplication._initializeMetadata method overwrite if it's not already been set.

Finally, in PDFViewerApplication._initializeJavaScript, the fallback _contentLength handling is now moved to just after the fallback documentInfo handling, such that all the fallback code is in one place within the method.

…wer, related mostly to scripting

Ensure that `PDFViewerApplication._contentLength` is always updated with the *correct* length, as returned by `PDFDocumentProxy.getDownloadInfo`, and only let the `PDFViewerApplication._initializeMetadata` method overwrite if it's not already been set.

Finally, in `PDFViewerApplication._initializeJavaScript`, the fallback `_contentLength` handling is now moved to just after the fallback `documentInfo` handling, such that all the fallback code is in one place within the method.
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/414387c151bd820/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2021

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/e0e43155b157b73/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/414387c151bd820/output.txt

Total script time: 2.78 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2021

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/e0e43155b157b73/output.txt

Total script time: 3.70 mins

  • Integration Tests: FAILED

@timvandermeij timvandermeij merged commit ac5168a into mozilla:master Jan 7, 2021
@timvandermeij
Copy link
Contributor

Looks good!

@Snuffleupagus Snuffleupagus deleted the scripting-contentLength branch January 7, 2021 22:04
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