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

Don't dispatch "pageclose" events if a "pageopen" wasn't dispatched for the page (PR 12747 follow-up) #12820

Merged
merged 2 commits into from
Jan 7, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Given that "pageopen" events are not guaranteed to occur, if the page becomes inactive before it finishes rendering, we should probably also avoid dispatching a "pageclose" event in that case to avoid confusing/inconsistent state in any event handlers.

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 6, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/0c4b031046a29a3/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 6, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/0c4b031046a29a3/output.txt

Total script time: 4.11 mins

Published

web/base_viewer.js Outdated Show resolved Hide resolved
…or the page (PR 12747 follow-up)

Given that "pageopen" events are not guaranteed to occur, if the page becomes inactive *before* it finishes rendering, we should probably also avoid dispatching a "pageclose" event in that case to avoid confusing/inconsistent state in any event handlers.
…wer._initializeScriptingEvents` (PR 12747 follow-up)

With the code dispatching a "pageopen" event on the existing (general) `BaseViewer` event "pagesinit", in practice this means that the `Set` is always being created. Hence we can simplify the method overall, by always initializing the `this._pageOpenPendingSet` property.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/fa3599326cbfc2b/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/fa3599326cbfc2b/output.txt

Total script time: 4.11 mins

Published

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

Thanks!

@Snuffleupagus Snuffleupagus deleted the pageclose-skip branch January 8, 2021 07:46
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.

4 participants