Created
April 17, 2018 00:07
-
-
Save wioux/7da667347f6c8365d154f3d7bbee8071 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/index.js b/index.js | |
index 6b53ab4..b6dce0b 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -87,15 +87,16 @@ class RenderPDF { | |
await LayerTree.enable(); | |
await Page.navigate({url}); | |
- await Emulation.setVirtualTimePolicy({policy: 'pauseIfNetworkFetchesPending', budget: 5000}); | |
const loaded = this.cbToPromise(Page.loadEventFired); | |
- const jsDone = this.cbToPromise(Emulation.virtualTimeBudgetExpired); | |
await this.profileScope('Wait for load', async () => { | |
await loaded; | |
}); | |
+ await Emulation.setVirtualTimePolicy({policy: 'pauseIfNetworkFetchesPending', budget: 5000}); | |
+ const jsDone = this.cbToPromise(Emulation.virtualTimeBudgetExpired); | |
+ | |
await this.profileScope('Wait for js execution', async () => { | |
await jsDone; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment