-
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
Printing refactor split from 7721 #7766
Printing refactor split from 7721 #7766
Conversation
Make sure that the print service is stopped as soon as possible when aborted, and that it is not possible for a (slow) promise to accidentally wipe the state of a print job that was started later.
- Move the global scratchCanvas to PDFPrintService. This is mainly to make it easier to reason about the state of scratchCanvas. In practice there is no difference because only one PDFPrintService instance can be instantiated at any given time. - Move all logic of using the rendered page to one location. This makes it easier to replace the printing logic later, when I add special handling to out-of-process frames in the Chrome extension.
- Renamed startPrint to performPrint to emphasize that the method does not start the print process (preparing pages for the printer), but that it does the actual printing (sending pages off to the printer). - Put performPrint in the PDFPrintService, so that it can be overridden if needed.
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Rob--W received. Current queue size: 0 Live output at: http://107.22.172.223:8877/cd0769c6c273abd/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/cd0769c6c273abd/output.txt Total script time: 3.48 mins Published |
@yurydelendik You've already reviewed the patches, please merge if you think that it's OK to merge. Only the first two patches are necessary to fix #7720, the other two only make it easier to extend the PDF printing logic later, if wanted. |
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2fa8c31ff31be3f/output.txt |
Thank you for the patch |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/2fa8c31ff31be3f/output.txt Total script time: 3.29 mins Published |
…rom-7721 Printing refactor split from 7721
This PR contains all reviewed commits from #7721 (without changes) and fixes #7720.
Maybe the complex OOP printing patch from the other PR is not needed if Chrome fixes the underlying bug before Chrome-with-the-bug reaches the stable channel.