mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-15 22:25:57 +08:00
fix: split report handler from other page preps
This commit is contained in:
parent
036f6dc776
commit
bfc6d678d8
@ -193,7 +193,9 @@ function giveSnapshot() {
|
||||
return r;
|
||||
}
|
||||
`));
|
||||
preparations.push(page.evaluateOnNewDocument(`
|
||||
await Promise.all(preparations);
|
||||
|
||||
await page.evaluateOnNewDocument(`
|
||||
let aftershot = undefined;
|
||||
const handlePageLoad = () => {
|
||||
if (document.readyState !== 'complete') {
|
||||
@ -215,8 +217,7 @@ const handlePageLoad = () => {
|
||||
};
|
||||
document.addEventListener('readystatechange', handlePageLoad);
|
||||
document.addEventListener('load', handlePageLoad);
|
||||
`));
|
||||
await Promise.all(preparations);
|
||||
`);
|
||||
|
||||
// TODO: further setup the page;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user