Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] CDPSessions for Web Workers #22992

Closed
iustinpericica opened this issue May 12, 2023 · 4 comments
Closed

[Feature] CDPSessions for Web Workers #22992

iustinpericica opened this issue May 12, 2023 · 4 comments

Comments

@iustinpericica
Copy link
Member

I need to create CDP Sessions to Web Workers available in a page. I've seen that you currently support only instances of Page and Frames.

I've seen you already collect Web Workers using Target.attachedToTarget

this._page._addWorker(event.sessionId, worker);

that returns the sessionId needed to send CDP requests to a specific target.

const id = this._connection._rawSend(this._sessionId, method, params);

Do you consider adding support for CDP Connection to Web Workers?
If not, is there a way to send from client raw commands to CDP ( sessionId, method, params ) so maybe I can collect sessionIds separetly and then make use of existing CDP Connection of Playwright.

Thanks!

@pavelfeldman
Copy link
Member

There are no such plans. What is your use case?

@iustinpericica
Copy link
Member Author

I need to take coverage from all Targets available in a web app ( all pages and web workers ).

To take coverage from pages I use existing Playwright CDP Sessions to send CDP Commands.

If you consider CDP Sessions on Web workers a good feature, I can try to open a PR on that.

@pavelfeldman
Copy link
Member

I don't think we want to see more of CDP exposed on top of what we have. Your problem is also tricky in a sense that workers are dynamic, they come and go, so the problem of tracking the coverage of everything is quite tricky to solve.

@pavelfeldman
Copy link
Member

I'll close it as out of scope for Playwright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants