Action Lock (Deterministic Execution)
Phase 2 β Freezes the page completely while the AI agent is thinking. No JavaScript, no timers, no layout reflows, no animations, no events. The page the agent analyzed is exactly the page it acts on.
The Problem
Between reading the page and executing an action, the DOM can change. JavaScript timers fire, CSS animations move elements, network callbacks update content, and event handlers reshape the layout. The agent clicks where a button was, not where it is.
How It Works
Action Lock patches Firefoxβs C++ core (nsDocShell) with two new methods:
suspendPage()β freezes the refresh driver, suspends all timers/intervals/network callbacks, and suppresses event handlingresumePage()β reverses the freeze in opposite order
The freeze pipeline:
Page.setActionLock({enabled: true})
β
βΌ
1. allowJavascript = false (all frames)
β
βΌ
2. nsRefreshDriver::Freeze()
- No layout reflow
- No CSS animation ticks
- No requestAnimationFrame
β
βΌ
3. nsPIDOMWindowInner::Suspend()
- setTimeout/setInterval paused
- Promise microtasks held
- Network callbacks queued
β
βΌ
4. PresShell::SuppressEventHandling()
- Mouse/keyboard events dropped
- Mutation observers paused
βββββββββββββββββββββββββββββββ
Page is now deterministically frozen
βββββββββββββββββββββββββββββββ
Page.setActionLock({enabled: false})
β
βΌ
Thaw in reverse order: 4 β 3 β 2 β 1Protocol
// Freeze
{"method": "Page.setActionLock", "params": {"enabled": true}}
// Thaw
{"method": "Page.setActionLock", "params": {"enabled": false}}Safety: Navigation Auto-Release
If the page navigates while the lock is held, the lock is automatically released. This prevents deadlocks from agents that freeze a page and then navigate away.
Configuration
Action Lock is enabled by default (the method is available). To disable the capability entirely:
vulpineos.actionlock.enabled = falseFiles Modified
patches/action-lock.patchβ C++ patch addingsuspendPage()/resumePage()tonsDocShelladditions/juggler/protocol/Protocol.jsβPage.setActionLockmethod definitionadditions/juggler/protocol/PageHandler.jsβ handler routingadditions/juggler/TargetRegistry.jsβPageTarget.setActionLock()IPC bridgeadditions/juggler/content/main.jsβ content-process freeze/thaw logicsettings/camoufox.cfgβvulpineos.actionlock.enabledpreference