Backends¶
wavexis supports two backends with full feature parity as of v1.7.0.
CDP backend (cdpwave)¶
The default backend. Uses the Chrome DevTools Protocol directly.
All 100+ methods are supported natively.
BiDi backend (bidiwave)¶
WebDriver BiDi backend. Uses a combination of:
- BiDi native commands —
browsingContext.navigate,script.evaluate,storage.getCookies, etc. - JS workarounds —
script.evaluatewith JavaScript for DOM, CSS, service workers, animations, cache storage - CDP bridge —
browser.cdp.sendCommandfor Debugger, WebAuthn, WebAudio, Media, Cast, Bluetooth, performance profiling, accessibility, IndexedDB, HAR
All 100+ methods are supported. Zero NotImplementedError.
BiDi implementation strategies¶
| Strategy | Used for |
|---|---|
| BiDi native | Navigation, screenshots, tabs, cookies, contexts, dialogs, permissions, input, storage |
| JS workaround | DOM, CSS inspection, overlay, cache storage, service workers, animations |
| CDP bridge | Performance profiling, accessibility, debug, HAR, IndexedDB, WebAuthn, WebAudio, Media, Cast, Bluetooth, security, downloads, extensions, preferences |
Selecting a backend¶
Use the --backend global flag:
wavexis --backend cdp screenshot https://example.com -o out.png
wavexis --backend bidi screenshot https://example.com -o out.png
Checking installation¶
Output:
Listing available backends¶
When to use which¶
- CDP — Chrome/Edge only. Most direct protocol access. Best for debugging and profiling.
- BiDi — Works with any WebDriver BiDi-compatible browser (Chrome, Firefox, Safari). Best for cross-browser automation. Falls back to CDP bridge for Chrome-specific features.
Graceful backend degradation¶
If the preferred backend cannot be created (e.g. dependency not installed), wavexis
automatically falls back to the next available backend. This is handled by
BackendManager.select_with_fallback():
# Prefers CDP, falls back to BiDi if cdpwave is not installed
wavexis screenshot https://example.com -o out.png
# Prefers BiDi, falls back to CDP if bidiwave is not installed
wavexis --backend bidi screenshot https://example.com -o out.png
This applies to both CLI commands and serve mode. The fallback only handles
backend creation failures (e.g. ImportError). Browser launch failures
are handled by each action's error handling.