make it a little more specific

This commit is contained in:
Simon Knott 2024-07-31 13:58:24 +02:00
parent 9b6ce75f5f
commit 118cb77ba9
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ import type * as frames from './frames';
import type { InjectedScript, HitTargetInterceptionResult, ElementState } from './injected/injectedScript';
import type { CallMetadata } from './instrumentation';
import * as js from './javascript';
import type { Page } from './page';
import { Page } from './page';
import type { Progress } from './progress';
import { ProgressController } from './progress';
import type * as types from './types';
@ -56,6 +56,8 @@ export class FrameExecutionContext extends js.ExecutionContext {
super(frame, delegate, world || 'content-script');
this.frame = frame;
this.world = world;
this.frame._page.on(Page.Events.Crash, () => this.contextDestroyed('Page crashed'));
}
override adoptIfNeeded(handle: js.JSHandle): Promise<js.JSHandle> | null {

View file

@ -495,8 +495,6 @@ export class Frame extends SdkObject {
this._currentDocument = { documentId: undefined, request: undefined };
this.selectors = new FrameSelectors(this);
this._page.on(Page.Events.Crash, () => this._onDetached());
this._contextData.set('main', { contextPromise: new ManualPromise(), context: null });
this._contextData.set('utility', { contextPromise: new ManualPromise(), context: null });
this._setContext('main', null);