mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-16 03:16:00 +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;
|
return r;
|
||||||
}
|
}
|
||||||
`));
|
`));
|
||||||
preparations.push(page.evaluateOnNewDocument(`
|
await Promise.all(preparations);
|
||||||
|
|
||||||
|
await page.evaluateOnNewDocument(`
|
||||||
let aftershot = undefined;
|
let aftershot = undefined;
|
||||||
const handlePageLoad = () => {
|
const handlePageLoad = () => {
|
||||||
if (document.readyState !== 'complete') {
|
if (document.readyState !== 'complete') {
|
||||||
@ -215,8 +217,7 @@ const handlePageLoad = () => {
|
|||||||
};
|
};
|
||||||
document.addEventListener('readystatechange', handlePageLoad);
|
document.addEventListener('readystatechange', handlePageLoad);
|
||||||
document.addEventListener('load', handlePageLoad);
|
document.addEventListener('load', handlePageLoad);
|
||||||
`));
|
`);
|
||||||
await Promise.all(preparations);
|
|
||||||
|
|
||||||
// TODO: further setup the page;
|
// TODO: further setup the page;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user