Spaces:
Build error
Build error
fix: wait-for-selector stalling process
Browse files
src/services/puppeteer.ts
CHANGED
|
@@ -1210,7 +1210,6 @@ export class PuppeteerControl extends AsyncService {
|
|
| 1210 |
}
|
| 1211 |
await Promise.race([Promise.allSettled([...pageScriptEvaluations, ...frameScriptEvaluations]), delayPromise])
|
| 1212 |
.catch(() => void 0);
|
| 1213 |
-
finalizationPromise = doFinalization();
|
| 1214 |
return stuff;
|
| 1215 |
});
|
| 1216 |
if (options.waitForSelector) {
|
|
@@ -1232,16 +1231,16 @@ export class PuppeteerControl extends AsyncService {
|
|
| 1232 |
});
|
| 1233 |
return p as any;
|
| 1234 |
});
|
| 1235 |
-
|
|
|
|
|
|
|
| 1236 |
}
|
| 1237 |
|
| 1238 |
try {
|
| 1239 |
let lastHTML = snapshot?.html;
|
| 1240 |
while (true) {
|
| 1241 |
-
const ckpt = [nextSnapshotDeferred.promise, gotoPromise];
|
| 1242 |
-
|
| 1243 |
-
ckpt.push(waitForPromise);
|
| 1244 |
-
}
|
| 1245 |
if (options.minIntervalMs) {
|
| 1246 |
ckpt.push(delay(options.minIntervalMs));
|
| 1247 |
}
|
|
|
|
| 1210 |
}
|
| 1211 |
await Promise.race([Promise.allSettled([...pageScriptEvaluations, ...frameScriptEvaluations]), delayPromise])
|
| 1212 |
.catch(() => void 0);
|
|
|
|
| 1213 |
return stuff;
|
| 1214 |
});
|
| 1215 |
if (options.waitForSelector) {
|
|
|
|
| 1231 |
});
|
| 1232 |
return p as any;
|
| 1233 |
});
|
| 1234 |
+
finalizationPromise = Promise.allSettled([waitForPromise, gotoPromise]).then(doFinalization);
|
| 1235 |
+
} else {
|
| 1236 |
+
finalizationPromise = gotoPromise.then(doFinalization);
|
| 1237 |
}
|
| 1238 |
|
| 1239 |
try {
|
| 1240 |
let lastHTML = snapshot?.html;
|
| 1241 |
while (true) {
|
| 1242 |
+
const ckpt = [nextSnapshotDeferred.promise, waitForPromise ?? gotoPromise];
|
| 1243 |
+
|
|
|
|
|
|
|
| 1244 |
if (options.minIntervalMs) {
|
| 1245 |
ckpt.push(delay(options.minIntervalMs));
|
| 1246 |
}
|