-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
#10810 pick the right target using given window handle #10811
#10810 pick the right target using given window handle #10811
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #10811 +/- ##
=======================================
Coverage 50.46% 50.46%
=======================================
Files 84 84
Lines 5477 5477
Branches 278 278
=======================================
Hits 2764 2764
Misses 2435 2435
Partials 278 278 Continue to review full report at Codecov.
|
Thank you for your contribution! I appreciate that the changes are trying to create a session correctly in the current tab. However, the changes are a breaking change to two public APIs. One way to tackle this could be to find a way to not explicitly pass the windowHandle id. Maybe have a method in DevTools class that lets the user set the pageId. If that is available then that is used else the it continues to use the first page found. If you think there is a better approach to tackle this, then feel free to discuss it. |
@pujagani There is a simpler way probably. |
Keeping both the methods and calling out the default behavior was the first idea. But, I am not sure if we want to remove the old methods createSession() and createSessionIfThereIsNotOne() at some point. Hence, I suggested allowing the user to set the pageId and use that if available. CC: @diemol When time permits, can you please have a look and suggest what might be the best way forward? Thank you! |
I realized that user doesn't even need to set pageId.
Nothing changes for end user. |
That would be ideal from the user's perspective. The current Devtools design ties the lifecycle of a page session with the parent session. So to create a new page session, a fresh CDP session will be required. As you mentioned, this will require major changes including managing different page sessions and ensuring there are no hanging sessions if the parent/page session is closed. The long-term goal is to move to BiDi and only support that once all browsers support BiDi fully. I am not sure if it is worth investing time and effort to get this done accurately without a major ask from the users. However, I agree that there has to be a way to allow users to provide the page they want the CDP session for. For that, one way is to provide overloaded methods |
I believe @asolntsev idea is very good because it would provide a better user experience. However, it requires considerable effort, and given that BiDi is slowly coming in, making major changes to the CDP integration is less than ideal. I would keep both signatures, and when the window handle is passed by the user, use that one. |
…fThereIsNotOne() for backward compatibility
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @asolntsev!
Description
Fix for issue #10810
Types of changes