fix: scope CDP tab sessions and simplify recording sessionId routing
This commit is contained in:
@@ -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,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,6 +1,6 @@
|
||||
{
|
||||
"name": "mcp-extension",
|
||||
"version": "0.0.71",
|
||||
"version": "0.0.72",
|
||||
"description": "Playwright MCP Browser Extension",
|
||||
"private": true,
|
||||
"repository": {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user