Skip to content

Conversation

@mafredri
Copy link
Owner

@mafredri mafredri commented Dec 7, 2025

Chrome is deprecating non-flattened sessions (crbug.com/991325) where
commands are wrapped via Target.SendMessageToTarget. Flattened mode
includes the sessionId directly in the JSON-RPC message instead.

Add rpcc.NewSession for creating session-scoped connections that share
the parent's websocket I/O. WithSessionClose allows registering a
cleanup callback for detachment.

session.Manager now uses flattened mode by default, requiring Chrome 77+.
WithNoFlatten opts into legacy mode for older versions.

Closes #109

@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

❌ Patch coverage is 91.39344% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.5%. Comparing base (715c982) to head (2468c63).

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #154     +/-   ##
=======================================
+ Coverage   39.7%   42.5%   +2.7%     
=======================================
  Files         25      27      +2     
  Lines       2325    2468    +143     
=======================================
+ Hits         924    1048    +124     
- Misses      1362    1372     +10     
- Partials      39      48      +9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mafredri mafredri force-pushed the mafredri/flattened-protocol branch 11 times, most recently from a1611ef to 385af26 Compare December 7, 2025 21:33
Chrome is deprecating non-flattened sessions (crbug.com/991325) where
commands are wrapped via Target.SendMessageToTarget. Flattened mode
includes the sessionId directly in the JSON-RPC message instead.

Add rpcc.NewSession for creating session-scoped connections that share
the parent's websocket I/O. WithSessionClose allows registering a
cleanup callback for detachment.

session.Manager now uses flattened mode by default, requiring Chrome 77+.
WithNoFlatten opts into legacy mode for older versions.

Closes #109
@mafredri mafredri force-pushed the mafredri/flattened-protocol branch from 385af26 to 2468c63 Compare December 7, 2025 23:12
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

Successfully merging this pull request may close these issues.

2 participants