mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-15 23:15:53 +08:00
fix: custom script may listen to mutationIdle
This commit is contained in:
parent
f7dbadffb7
commit
8121d62324
@ -619,9 +619,6 @@ export class CrawlerOptions extends AutoCastable {
|
|||||||
if ((this.respondWith.includes('vlm') || this.respondWith.includes('screenshot')) && !snapshot.screenshot) {
|
if ((this.respondWith.includes('vlm') || this.respondWith.includes('screenshot')) && !snapshot.screenshot) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.respondTiming === RESPOND_TIMING.MUTATION_IDLE && snapshot.lastMutationIdle) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (this.respondTiming === RESPOND_TIMING.RESOURCE_IDLE && snapshot.lastContentResourceLoaded) {
|
if (this.respondTiming === RESPOND_TIMING.RESOURCE_IDLE && snapshot.lastContentResourceLoaded) {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if ((snapshot.lastContentResourceLoaded + 500) < now) {
|
if ((snapshot.lastContentResourceLoaded + 500) < now) {
|
||||||
@ -629,11 +626,14 @@ export class CrawlerOptions extends AutoCastable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.injectFrameScript?.length || this.injectPageScript?.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (this.respondTiming === RESPOND_TIMING.NETWORK_IDLE) {
|
if (this.respondTiming === RESPOND_TIMING.NETWORK_IDLE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.injectFrameScript?.length || this.injectPageScript?.length) {
|
if (this.respondTiming === RESPOND_TIMING.MUTATION_IDLE && snapshot.lastMutationIdle) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (this.respondWith.includes('lm')) {
|
if (this.respondWith.includes('lm')) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user