Add an authenticated storage-state reset endpoint that closes the live browser context without checkpointing, waits for in-flight persistence writes, and removes the saved state so the next session starts fresh.
Co-authored-by: PluginsKers <ikers@foxmail.com>
Add opt-in IndexedDB capture to persisted Playwright storage state, keep VNC exports consistent with persistence configuration, and persist the exact exported snapshot without serializing the browser twice.
Co-authored-by: Ian Ker-Seymer <hello@ianks.com>
The persistence plugin needs a live Playwright context to save storage
state (cookies + localStorage), but session:destroyed fired after
context.close(), causing storageState() to fail with 'Target page,
context or browser has been closed'.
Add a new session:destroying event that fires before context.close(),
and move persistence checkpointing there. Keep session:destroyed
after cleanup for backward compatibility with other plugins.
Changes:
- server.js: emit session:destroying before context.close()
- lib/plugins.js: document the new event
- plugins/persistence/index.js: listen on session:destroying for
checkpoint, session:destroyed for cleanup only
- plugins/persistence/plugin.test.js: update test to use new event
Co-authored-by: nobita2041 <nobita2041@users.noreply.github.com>
VNC plugin (plugins/vnc/) exposes Camoufox's virtual display via noVNC,
enabling interactive login for sites with fingerprint-based session
validation, CAPTCHAs, or MFA prompts.
- Plugin subclasses VirtualDisplay to override Xvfb resolution (default
1920x1080, configurable via plugins.vnc.resolution or VNC_RESOLUTION)
- vnc-watcher.sh detects Camoufox's dynamically-assigned Xvfb display,
attaches x11vnc, and proxies via noVNC on port 6080
- Registers GET /sessions/:userId/storage_state to export Playwright
storageState (cookies + localStorage) after interactive login
- Emits session:storage:export event for persistence plugin integration
- System deps declared in apt.txt, installed via install-plugin-deps.sh
Plugin system changes:
- ctx passed by reference (not spread) so plugins can mutate factories
like ctx.createVirtualDisplay
- pluginConfig moved to 3rd arg of register(app, ctx, pluginConfig)
- server.js exposes createVirtualDisplay factory + VirtualDisplay class
on pluginCtx
Dockerfile: fix build for local Makefile (bind mounts from dist/),
name first stage for multi-stage support.
Co-authored-by: Leone Parise <leone.parise@gmail.com>
Persistence as a plugin (not core) — camofox stays stateless by default.
Plugin hooks into session:creating, session:created, session:cookies:import,
session:destroyed, and server:shutdown lifecycle events to save/restore
Playwright storageState.
Plugin system now supports per-plugin config objects in camofox.config.json:
{ "plugins": { "youtube": { "enabled": true }, "persistence": { ... } } }
Array format still supported for backward compatibility.
Plugin config is passed to register() as ctx.pluginConfig.
Co-authored-by: company8 <compan@post.com>