mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: remove extra function
This commit is contained in:
parent
e8204fc2f0
commit
3bbcab5564
@ -223,9 +223,11 @@ export class LifecycleWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#checkLifecycleComplete(): void {
|
#checkLifecycleComplete(): void {
|
||||||
if (!checkLifecycle(this.#frame, this.#expectedLifecycle)) {
|
for (const event of this.#expectedLifecycle) {
|
||||||
|
if (!this.#frame._lifecycleEvents.has(event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.#lifecycleDeferred.resolve();
|
this.#lifecycleDeferred.resolve();
|
||||||
if (this.#hasSameDocumentNavigation) {
|
if (this.#hasSameDocumentNavigation) {
|
||||||
@ -234,19 +236,6 @@ export class LifecycleWatcher {
|
|||||||
if (this.#swapped || this.#frame._loaderId !== this.#initialLoaderId) {
|
if (this.#swapped || this.#frame._loaderId !== this.#initialLoaderId) {
|
||||||
this.#newDocumentNavigationDeferred.resolve(undefined);
|
this.#newDocumentNavigationDeferred.resolve(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkLifecycle(
|
|
||||||
frame: CdpFrame,
|
|
||||||
expectedLifecycle: ProtocolLifeCycleEvent[]
|
|
||||||
): boolean {
|
|
||||||
for (const event of expectedLifecycle) {
|
|
||||||
if (!frame._lifecycleEvents.has(event)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user