Spaces:
Build error
Build error
fix: custom script may listen to mutationIdle
Browse files
src/dto/crawler-options.ts
CHANGED
|
@@ -619,9 +619,6 @@ export class CrawlerOptions extends AutoCastable {
|
|
| 619 |
if ((this.respondWith.includes('vlm') || this.respondWith.includes('screenshot')) && !snapshot.screenshot) {
|
| 620 |
return false;
|
| 621 |
}
|
| 622 |
-
if (this.respondTiming === RESPOND_TIMING.MUTATION_IDLE && snapshot.lastMutationIdle) {
|
| 623 |
-
return true;
|
| 624 |
-
}
|
| 625 |
if (this.respondTiming === RESPOND_TIMING.RESOURCE_IDLE && snapshot.lastContentResourceLoaded) {
|
| 626 |
const now = Date.now();
|
| 627 |
if ((snapshot.lastContentResourceLoaded + 500) < now) {
|
|
@@ -629,12 +626,15 @@ export class CrawlerOptions extends AutoCastable {
|
|
| 629 |
}
|
| 630 |
}
|
| 631 |
|
| 632 |
-
if (this.
|
| 633 |
return false;
|
| 634 |
}
|
| 635 |
-
if (this.
|
| 636 |
return false;
|
| 637 |
}
|
|
|
|
|
|
|
|
|
|
| 638 |
if (this.respondWith.includes('lm')) {
|
| 639 |
return false;
|
| 640 |
}
|
|
|
|
| 619 |
if ((this.respondWith.includes('vlm') || this.respondWith.includes('screenshot')) && !snapshot.screenshot) {
|
| 620 |
return false;
|
| 621 |
}
|
|
|
|
|
|
|
|
|
|
| 622 |
if (this.respondTiming === RESPOND_TIMING.RESOURCE_IDLE && snapshot.lastContentResourceLoaded) {
|
| 623 |
const now = Date.now();
|
| 624 |
if ((snapshot.lastContentResourceLoaded + 500) < now) {
|
|
|
|
| 626 |
}
|
| 627 |
}
|
| 628 |
|
| 629 |
+
if (this.injectFrameScript?.length || this.injectPageScript?.length) {
|
| 630 |
return false;
|
| 631 |
}
|
| 632 |
+
if (this.respondTiming === RESPOND_TIMING.NETWORK_IDLE) {
|
| 633 |
return false;
|
| 634 |
}
|
| 635 |
+
if (this.respondTiming === RESPOND_TIMING.MUTATION_IDLE && snapshot.lastMutationIdle) {
|
| 636 |
+
return true;
|
| 637 |
+
}
|
| 638 |
if (this.respondWith.includes('lm')) {
|
| 639 |
return false;
|
| 640 |
}
|