@d-zero/puppeteer-page-scan 4.3.4 → 4.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/before-page-scan.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function beforePageScan(page, url, options) {
|
|
|
10
10
|
const name = options?.name ?? 'default';
|
|
11
11
|
const width = options?.width ?? 1400;
|
|
12
12
|
const resolution = options?.resolution;
|
|
13
|
-
const timeout = options?.timeout ||
|
|
13
|
+
const timeout = options?.timeout || 5000;
|
|
14
14
|
const countDownId = `${name}${url}_timeout`;
|
|
15
15
|
listener?.('setViewport', { name, width, resolution });
|
|
16
16
|
await page.setViewport({
|
|
@@ -74,10 +74,10 @@ async function navigateWithFallback(page, url, timeout, isReload, listener, name
|
|
|
74
74
|
});
|
|
75
75
|
// Retry with networkidle2 (more lenient)
|
|
76
76
|
if (isReload) {
|
|
77
|
-
await page.reload({ waitUntil: 'networkidle2', timeout });
|
|
77
|
+
await page.reload({ waitUntil: 'networkidle2', timeout: timeout * 3 });
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
await page.goto(url, { waitUntil: 'networkidle2', timeout });
|
|
80
|
+
await page.goto(url, { waitUntil: 'networkidle2', timeout: timeout * 3 });
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
@@ -5,7 +5,7 @@ export const pageScanLoggers = (log) => ({
|
|
|
5
5
|
},
|
|
6
6
|
load({ type, timeout, id }) {
|
|
7
7
|
const timeoutSec = Math.floor(timeout / 1000);
|
|
8
|
-
log(`%earth% ${type === 'open' ? 'Open' : 'Reload'} page / Timeout: %countdown(${
|
|
8
|
+
log(`%earth% ${type === 'open' ? 'Open' : 'Reload'} page / Timeout: %countdown(${timeout},${id}_timeout,s)%s/${timeoutSec}s`);
|
|
9
9
|
},
|
|
10
10
|
hook({ message }) {
|
|
11
11
|
log(message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/puppeteer-page-scan",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
4
4
|
"description": "Scanning page function for puppeteer",
|
|
5
5
|
"author": "D-ZERO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"puppeteer": "24.34.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9aa03b3928e271d45865c6e2eff4c89041fe20a2"
|
|
36
36
|
}
|