-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Move handling of the PageOpen/PageClose events into the PDFScriptingManager
(PR 13042 follow-up)
#13054
Move handling of the PageOpen/PageClose events into the PDFScriptingManager
(PR 13042 follow-up)
#13054
Conversation
PDFScriptingManager
(PR 13042 follow-upPDFScriptingManager
(PR 13042 follow-up)
4a0c163
to
05f4f2e
Compare
if (event?.source !== window) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is probably not necessary, it's a "better safe than sorry"-type of check I forgot to add in PR #13042
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c2e88537db38ae4/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/3db7f233efb79c0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/c2e88537db38ae4/output.txt Total script time: 3.07 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/3db7f233efb79c0/output.txt Total script time: 5.01 mins
|
05f4f2e
to
65b0324
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/730659ef044e471/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/730659ef044e471/output.txt Total script time: 3.99 mins Published |
65b0324
to
df523e3
Compare
…Manager` (PR 13042 follow-up) By moving this code from the `BaseViewer` and into `PDFScriptingManager`, all of the scripting initialization/handling code is now limited to just one file/class which help overall readability (in my opinion). Also, this patch is a *net reduction* in number of lines of code which can never hurt. As part of these changes, the intermediary "pageopen"/"pageclose" events are now removed in favor of using the "regular" viewer events directly in `PDFScriptingManager`. Hence this removes some (strictly unnecessary) indirection in the current code, when handling PageOpen/PageClose events, which leads to overall fewer function calls in this part of the code.
df523e3
to
87dd93b
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/b123498192403fc/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/935aae3c2e61ade/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/b123498192403fc/output.txt Total script time: 3.50 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/935aae3c2e61ade/output.txt Total script time: 5.11 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/fa7005b16318962/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/207f470c19968b9/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/fa7005b16318962/output.txt Total script time: 3.05 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/207f470c19968b9/output.txt Total script time: 5.23 mins
|
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/1e0a031f08ed765/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/1e0a031f08ed765/output.txt Total script time: 4.06 mins Published |
Thank you for simplifying this! |
By moving this code from the
BaseViewer
and intoPDFScriptingManager
, all of the scripting initialization/handling code is now limited to just one file/class which help overall readability (in my opinion). Also, this patch is a net reduction in number of lines of code which can never hurt.As part of these changes, the intermediary "pageopen"/"pageclose" events are now removed in favor of using the "regular" viewer events directly in
PDFScriptingManager
. Hence this removes some (strictly unnecessary) indirection in the current code, when handling PageOpen/PageClose events, which leads to overall fewer function calls in this part of the code.Slightly smaller/easier diff with https://github.com/mozilla/pdf.js/pull/13054/files?w=1