Skip to content

[Feature] debugging client script #1400

@Meir017

Description

@Meir017

I have a case where I'm executing a script in the browser using page.evaluate and I'm trying to debug that script;
I tried installing https://github.com/microsoft/vscode-chrome-debug and configuring playwright to connect locally using websocket and port 9222.

with the configuration

{
    "type": "chrome",
    "request": "attach",
    "name": "Attach to Chrome",
    "port": 9222,
    "webRoot": "${workspaceFolder}"
}

for example:

var result = await page.evaluate(() => {
    var a = { b: 6 };
    debugger;
    return a;
});
expect(result.b).toBe(6);

I set a breakpoint right before the page.evaluate execution and then started the chrome debugger

vscode was able to list the opened pages but when I selected one I got the following error:
Could not load source '__playwright_evaluation_script__': No debug adapter found. Can not send 'source'..

is this something that could work? or should work?

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