fix: scope CDP tab sessions and simplify recording sessionId routing

This commit is contained in:
Tommy D. Rossi
2026-02-25 16:52:41 +01:00
parent 40f9c54f74
commit 95ff2a797d
10 changed files with 74 additions and 53 deletions
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## 0.0.72
### Bug Fixes
- **Use runtime-scoped root CDP tab session IDs**: Root tab sessions now use `pw-tab-<scope>-<n>` instead of `pw-tab-<n>`, where scope is a random value generated once per extension runtime. This prevents session ID collisions across multiple connected Chrome profiles.
## 0.0.71
### Bug Fixes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Playwriter",
"version": "0.0.71",
"version": "0.0.72",
"description": "Automate your Browser using Cursor, Claude, VS Code. More capable and context efficient than Playwright MCP.",
"permissions": [
"debugger",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mcp-extension",
"version": "0.0.71",
"version": "0.0.72",
"description": "Playwright MCP Browser Extension",
"private": true,
"repository": {
+10 -1
View File
@@ -66,6 +66,15 @@ async function detectBrowserName(): Promise<string> {
}
let identityPromise: Promise<ExtensionIdentity> | null = null
const tabSessionScope = (() => {
const values = new Uint32Array(2)
crypto.getRandomValues(values)
return Array.from(values)
.map((value) => {
return value.toString(36)
})
.join('')
})()
async function getExtensionIdentity(): Promise<ExtensionIdentity> {
if (identityPromise) {
@@ -1070,7 +1079,7 @@ async function attachTab(
}
const attachOrder = nextSessionId
const sessionId = `pw-tab-${nextSessionId++}`
const sessionId = `pw-tab-${tabSessionScope}-${nextSessionId++}`
store.setState((state) => {
const newTabs = new Map(state.tabs)