feat: harden relay sessions and recording UX across extension + playwriter

This commit batches the pending workspace updates that were coupled in practice: extension reliability fixes, ghost cursor persistence across MPA navigations, timeout tuning, and aligned docs/versioning updates so behavior and guidance stay in sync.

Key updates:\n- extension: add MV3 keepalive via chrome.alarms, add alarms permission, and bump extension changelog/version to 0.0.73 to reduce silent relay disconnects while idle\n- playwriter runtime: raise default action timeout to 60s while keeping navigation timeout separate; increase relay /version fetch timeout to 2000ms\n- recording + cursor: add persistent cursor init scripts with Page.addScriptToEvaluateOnNewDocument, remove init script on teardown, and ensure cursor enablement before applying mouse actions\n- demo video defaults: use 0.5s side buffer (1s total) and default idle speed 6x for createDemoVideo/computeIdleSections\n- tests/docs: keep click-error tests deterministic with explicit 5000ms per-click timeout, remove outdated click-timeout section from skill mistakes, and update package/changelog entries
This commit is contained in:
Tommy D. Rossi
2026-02-28 22:12:07 +01:00
parent 9222a96a98
commit f793dd8ac4
13 changed files with 191 additions and 70 deletions
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## 0.0.73
### Bug Fixes
- **Service worker keepalive via chrome.alarms**: Added `chrome.alarms` keepalive to prevent Chrome MV3 from terminating the service worker when idle. Without this, the `maintainLoop` stops, the WebSocket closes, and the extension silently disconnects from the relay server — causing `session new` to fail with "Extension did not connect within timeout."
## 0.0.72
### Bug Fixes
+2 -1
View File
@@ -1,9 +1,10 @@
{
"manifest_version": 3,
"name": "Playwriter",
"version": "0.0.72",
"version": "0.0.73",
"description": "Automate your Browser using Cursor, Claude, VS Code. More capable and context efficient than Playwright MCP.",
"permissions": [
"alarms",
"debugger",
"tabGroups",
"contextMenus",
+12
View File
@@ -1483,6 +1483,18 @@ async function onActionClicked(tab: chrome.tabs.Tab): Promise<void> {
resetDebugger()
connectionManager.maintainLoop()
// MV3 service workers can be terminated by Chrome despite setInterval.
// chrome.alarms is the only reliable way to keep a service worker alive.
// Without this, the maintainLoop stops, the WebSocket closes, and the
// extension silently disconnects from the relay server.
chrome.alarms.create('keepalive', { periodInMinutes: 0.25 })
chrome.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === 'keepalive') {
// No-op — the alarm firing is enough to wake the service worker.
// The maintainLoop will handle reconnection if needed.
}
})
chrome.contextMenus
.remove('playwriter-pin-element')
.catch(() => {})