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:
@@ -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(() => {})
|
||||
|
||||
Reference in New Issue
Block a user