Skip to content

Execution context was destroyed, most likely because of a navigation #115

@lee3164

Description

@lee3164

+ const crSession = (this._page._delegate._sessions.get(this._id) || this._page._delegate._mainFrameSession)._client

@nwebson Hi, I found that this line has some bugs — sometimes it clears the main frame's context when a child frame attaches.
This happens because, when the specific frame's session is not found, the code falls back to using the main frame's session.

Playwright is supposed to create a child frame session when the Target.AttachedToTarget event is triggered, but sometimes the event does not trigger, and I’m not sure why. This behavior is unexpected.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions