8 Commits
Author SHA1 Message Date
PluginsKersandPluginsKers bd2a071a3d feat(persistence): reset complete session storage state (#6972)
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>
2026-07-19 21:37:15 -07:00
Ian Ker-SeymerandIan Ker-Seymer 24c414be29 feat(persistence): optionally include IndexedDB in storage state (#7225)
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>
2026-07-19 21:18:39 -07:00
nobita2041andnobita2041 1e14e3bda9 fix: add session:destroying event for persistence checkpoint (#75)
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>
2026-04-25 09:10:26 -07:00
Pradeep ElankumaranandEdilson Osorio Jr 50bf37f83d docs: add per-plugin AGENTS.md with contributor credits, update README
Co-authored-by: Edilson Osorio Jr <3277320+eddieoz@users.noreply.github.com>
2026-04-18 18:06:26 -07:00
Pradeep Elankumaran 981e20be2b feat: enable persistence by default, profiles at ~/.camofox/profiles 2026-04-18 18:02:44 -07:00
Pradeep Elankumaran 5740825921 fix: await async plugin hooks for mutating events 2026-04-18 17:38:29 -07:00
Pradeep ElankumaranandLeone Parise 0ac2490f29 feat: VNC plugin for interactive browser login + storage_state export
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>
2026-04-18 17:21:50 -07:00
Pradeep Elankumaranandcompany8 040fe2aef7 feat: persistence plugin + per-plugin config support
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>
2026-04-18 15:37:58 -07:00