Add support for Browser Contexts
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading ChromeRequest and the ChromeDevToolsClient.connect() entry point, then compare their current behavior with the linked Chrome DevTools Protocol flow for Target.createBrowserContext, Target.createTarget, and attachToTarget. Trace how the sessionId should travel across flattened WebSocket messages. Done means callers can create browser contexts and send associated domain messages with the required sessionId.
Written by the indexing model from the issue text.
Description
Request to add support for Browser Contexts for better session isolation.
The equivalent puppeteer support is here
Here is an example puppeteer flow:
puppeteer:protocol:SEND ► [ '{"method":"Target.createBrowserContext","params":{},"id":28}' ] +0ms
puppeteer:protocol:RECV ◀ '{"id":28,"result":{"browserContextId":"C3E91703B61927146F87752284522D91"}}'
puppeteer:protocol:SEND ► '{"method":"Target.createTarget","params":{"url":"about:blank","browserContextId":"C3E91703B61927146F87752284522D91"},"id":29}'
puppeteer:protocol:RECV ◀ '{"id":29,"result":{"targetId":"503504648E4964DDF803AA880852DBFF"}}'
// Puppeteer has used Target.setAutoAttach: we'd probably use Target.attachToTarget to get the sessionId
puppeteer:protocol:RECV ◀ '{"method":"Target.attachedToTarget","params":{"sessionId":"545C3C16B43606D627A1BA790C0898BA","targetInfo":{"targetId":"503504648E4964DDF803AA880852DBFF","type":"page","title":"","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"C3E91703B61927146F87752284522D91"},"waitingForDebugger":false},"sessionId":"4B112B2F9D850B67E51015A448C39790"}'
puppeteer:protocol:SEND ► '{"method":"Page.navigate","params":{"url":"http://www.example.com","frameId":"503504648E4964DDF803AA880852DBFF"},"id":47,"sessionId":"545C3C16B43606D627A1BA790C0898BA"}'
The upshot is that the flow above is used to obtain a sessionId (via browserContextId and targetId). This is then used across a single flattened web socket. The sessionId is required in all domain messaging.
So my initial thought are that ChromeRequest needs a sessionId (Note that this is not in the Chrome Dev Tools Protocol definitions; I think it is just implied), and the ChromeDevToolsClient needs an alternative to ChromeDevToolsClient.connect() that allows the user to create Contexts (as shown in the flow above). If using the Context method, then all messages will require the associated sessionId in the ChromeRequest messaging.
- Dominant language
- Java
- Stars
- 48
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HubSpot/ChromeDevToolsClient
-
Build fails with Java 25Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
List and close existing tabsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
parseChromeResponse results flattening flawed?Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
All issues in HubSpot/ChromeDevToolsClient
Similar issues
-
[destination-snowflake] Custom domains rejected unlike source connectionsPossibly taken @kuza55 claimed this today. Openautoteam community connectors/destination/snowflake team/use
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
component/operate kind/feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Forge coverage prompts carry text the agent cannot act onPossibly taken @graalvmbot claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
oracle/graalvm-reachability-metadata#10572 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IBM/sample-app-mod#55 ·