mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: remove unnecessary constructor parameters (#8837)
This commit is contained in:
parent
202ffce0aa
commit
5fba0dc932
@ -211,18 +211,8 @@ export class Frame {
|
||||
updateClient(client: CDPSession): void {
|
||||
this.#client = client;
|
||||
this.worlds = {
|
||||
[MAIN_WORLD]: new IsolatedWorld(
|
||||
client,
|
||||
this._frameManager,
|
||||
this,
|
||||
this._frameManager.timeoutSettings
|
||||
),
|
||||
[PUPPETEER_WORLD]: new IsolatedWorld(
|
||||
client,
|
||||
this._frameManager,
|
||||
this,
|
||||
this._frameManager.timeoutSettings
|
||||
),
|
||||
[MAIN_WORLD]: new IsolatedWorld(this),
|
||||
[PUPPETEER_WORLD]: new IsolatedWorld(this),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -121,10 +121,7 @@ export interface IsolatedWorldChart {
|
||||
* @internal
|
||||
*/
|
||||
export class IsolatedWorld {
|
||||
#frameManager: FrameManager;
|
||||
#client: CDPSession;
|
||||
#frame: Frame;
|
||||
#timeoutSettings: TimeoutSettings;
|
||||
#documentPromise: Promise<ElementHandle<Document>> | null = null;
|
||||
#contextPromise: DeferredPromise<ExecutionContext> = createDeferredPromise();
|
||||
#detached = false;
|
||||
@ -148,21 +145,25 @@ export class IsolatedWorld {
|
||||
return `${name}_${contextId}`;
|
||||
};
|
||||
|
||||
constructor(
|
||||
client: CDPSession,
|
||||
frameManager: FrameManager,
|
||||
frame: Frame,
|
||||
timeoutSettings: TimeoutSettings
|
||||
) {
|
||||
constructor(frame: Frame) {
|
||||
// Keep own reference to client because it might differ from the FrameManager's
|
||||
// client for OOP iframes.
|
||||
this.#client = client;
|
||||
this.#frameManager = frameManager;
|
||||
this.#frame = frame;
|
||||
this.#timeoutSettings = timeoutSettings;
|
||||
this.#client.on('Runtime.bindingCalled', this.#onBindingCalled);
|
||||
}
|
||||
|
||||
get #client(): CDPSession {
|
||||
return this.#frame._client();
|
||||
}
|
||||
|
||||
get #frameManager(): FrameManager {
|
||||
return this.#frame._frameManager;
|
||||
}
|
||||
|
||||
get #timeoutSettings(): TimeoutSettings {
|
||||
return this.#frameManager.timeoutSettings;
|
||||
}
|
||||
|
||||
frame(): Frame {
|
||||
return this.#frame;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user