Skip to content

[PM-37932] Recover browser IPC after process reload#20848

Draft
coroiu wants to merge 1 commit into
mainfrom
PM-37932-after-a-process-reload-of-browser-shared-unlock-breaks-between-web-and-browser
Draft

[PM-37932] Recover browser IPC after process reload#20848
coroiu wants to merge 1 commit into
mainfrom
PM-37932-after-a-process-reload-of-browser-shared-unlock-breaks-between-web-and-browser

Conversation

@coroiu
Copy link
Copy Markdown
Contributor

@coroiu coroiu commented May 25, 2026

Re-inject the IPC content script into already-open tabs when the service worker starts up. After a process reload (chrome.runtime.reload()), tabs opened before the reload retain a content script bound to the previous extension context, leaving the IPC bridge dead until a full page reload. The old instance now tears itself down via a long-lived port's onDisconnect so the freshly injected script can register its listeners without duplicating handlers.

🎟️ Tracking

📔 Objective

📸 Screenshots

Re-inject the IPC content script into already-open tabs when the service
worker starts up. After a process reload (`chrome.runtime.reload()`), tabs
opened before the reload retain a content script bound to the previous
extension context, leaving the IPC bridge dead until a full page reload.
The old instance now tears itself down via a long-lived port's onDisconnect
so the freshly injected script can register its listeners without
duplicating handlers.
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 6.89655% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.80%. Comparing base (c6ec252) to head (6477607).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ser/src/platform/ipc/content/ipc-content-script.ts 0.00% 20 Missing ⚠️
...platform/ipc/ipc-content-script-manager.service.ts 22.22% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20848      +/-   ##
==========================================
- Coverage   47.81%   47.80%   -0.01%     
==========================================
  Files        4006     4006              
  Lines      123309   123331      +22     
  Branches    18966    18969       +3     
==========================================
+ Hits        58963    58964       +1     
- Misses      59901    59922      +21     
  Partials     4445     4445              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant