96 Commits

Author SHA1 Message Date
daniel156161 eaa1469143 fix(extension): detect browser error pages earlier
Testing / test (push) Successful in 26s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 27s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 20s
Package Extension / package-extension (push) Successful in 28s
Build & Publish Package / publish (push) Successful in 31s
- Add shared browser error URL detection for Chrome, Edge, Brave, and Firefox-style about:error pages.
- Short-circuit read-only DOM and HTML commands with safe fallbacks when tabs are already on browser error pages.
- Fail navigation waits, DOM waits, polling, and URL watches with clearer error-page messages.
- Bump package and extension version to 0.9.8 and extend regression coverage for cross-browser error-page handling.
v0.9.8
2026-05-14 13:54:21 +02:00
daniel156161 f79ff0e3c2 fix(extension): handle browser error pages gracefully
Testing / test (push) Successful in 37s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 39s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 24s
- Treat chrome error page script failures as transient during injection retries.
- Return safe fallback values for read-only DOM commands when tabs land on browser error pages.
- Improve URL watch handling by checking pending URLs and reporting last seen URL/status on timeout.
- Bump package and extension version to 0.9.6 and add regression coverage for error-page behavior.
2026-05-14 13:39:09 +02:00
daniel156161 a8b433aa29 Add remote protocol compatibility workflow
Testing / test (push) Successful in 25s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 26s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 20s
2026-05-05 11:05:49 +02:00
daniel156161 94c87e244b Encrypt remote transport with post-quantum session keys
Testing / test (push) Successful in 21s
Package Extension / package-extension (push) Successful in 18s
Build & Publish Package / publish (push) Successful in 29s
v0.9.5
2026-05-05 10:49:38 +02:00
daniel156161 9096efd36a Fix ML-KEM encapsulation ordering
Testing / test (push) Successful in 22s
2026-05-05 10:40:06 +02:00
daniel156161 98396a7c7e Add post-quantum remote auth key exchange
Testing / test (push) Successful in 32s
2026-05-05 10:34:28 +02:00
daniel156161 30a42ba6d5 fix(auth): skip agent keys with comment (none)
Testing / test (push) Successful in 29s
gpg-agent retains YubiKey entries after card removal but resets the
comment to "(none)". Treating those as valid keys causes auth to
succeed against a ghost identity — skip them so the caller gets None
and the missing-card error path fires correctly.
2026-05-03 17:08:26 +02:00
daniel156161 533e9d328d fix: drop browser-cli ALPN restriction on TLS port 443
Testing / test (push) Failing after 14m32s
set_alpn_protocols(["browser-cli"]) caused TLS handshake failure
(no_application_protocol alert) when connecting through a reverse
proxy (e.g. Traefik) that terminates TLS but doesn't know the custom
ALPN. Plain TLS without ALPN negotiation works correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 16:58:24 +02:00
daniel156161 9177e989bd feat: default port 443 for domain remotes, strip from display (v0.9.4)
Testing / test (push) Failing after 13m12s
- Domain-like --remote endpoints default to port 443; :443 is optional
- _normalize_endpoint strips :443 before storage in remotes.json
- _load_remotes normalises keys on load (backward compat migration)
- _remote_display_name omits :443 for domain endpoints
- _resolve_connect_endpoint adds :443 back for TCP connection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 16:46:27 +02:00
daniel156161 7fd966014f set alpn protocol to browser-cli prevent h2/http1.1 ALPN confusion
Testing / test (push) Failing after 14m46s
2026-05-03 12:42:59 +02:00
daniel156161 217641d0ef fix: auto-wrap TLS for port 443 in _send_remote
Testing / test (push) Successful in 27s
Port 443 → ssl.create_default_context().wrap_socket() before the
challenge handshake so Traefik TCP routers with TLS termination work.
Other ports stay plain TCP.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 11:43:27 +02:00
daniel156161 0d5c49c19a refactor: split compat into package, harden serve proxy (v0.9.3)
Testing / test (push) Failing after 10m21s
- compat.py → compat/ package: auth.py (auth-field normalizers),
  commands.py (command-format shims), __init__.py (re-exports)
- Add _auth_0_9_3 transformer: normalizes pubkey to lowercase before auth
  so clients < 0.9.3 sending uppercase hex are accepted
- adapt_auth() now called before auth check in serve.py; command extracted
  after adapt_auth so future transformers can rename commands safely
- serve.py: deduplicate _recv_exact (import from client), unify
  resp/resp_payload across Windows/Unix branches, require lowercase hex
  pubkey (re.fullmatch), reorganize imports, drop unused os import
- client.py: move payload/framed construction inside branches (remote path
  no longer serializes JSON it never uses); fix _is_valid_key_spec
  operator precedence; import MAX_MSG_BYTES from version_manager
- auth.py: narrow except clause (ValueError instead of bare Exception)
- Bump version 0.9.2 → 0.9.3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 10:12:55 +02:00
daniel156161 c1a5ef9dd7 feat: token-auth removal, security hardening, Stripe-style compat layer (v0.9.2)
Testing / test (push) Successful in 41s
Package Extension / package-extension (push) Successful in 35s
Build & Publish Package / publish (push) Successful in 46s
- Remove token auth entirely; only Ed25519 pubkey auth or --no-auth
- Add 32 MB message-size cap in serve and client (DoS protection)
- Set Unix socket to 0o600 after bind in native_host (multi-user hardening)
- Enforce browser-cli/VERSION user-agent on all TCP connections
- Add PROTOCOL_MIN_CLIENT check (>= 0.9.0) server- and client-side
- Include server_version + min_client_version in challenge frame
- Add browser_cli/version_manager.py: parse_version, get_installed_version
- Add browser_cli/compat.py: Stripe-style versioning layer with adapt_request
  / adapt_response hooks; baseline 0.9.2, no shims needed yet
- Fix BrowserCLI key handling: no Path() wrap for agent specs
- Fix _multi_browser_targets() to forward key to remote_browser_targets()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.9.2
2026-05-02 21:59:46 +02:00
daniel156161 b98c4ae116 fix: validate key spec before saving/loading from remotes.json
Testing / test (push) Successful in 29s
A previous bug (fixed in fcd2e8b) caused str(AgentKey(...)) to be saved
as the key spec instead of the plain string "agent". This made
_load_private_key() return None, sending messages unsigned.

- _is_valid_key_spec() guards save_remote_key() against persisting
  serialized objects or other non-spec values
- key_for_remote() rejects already-persisted corrupt specs so fallback
  key loading still works

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 20:15:09 +02:00
daniel156161 fcd2e8b87b fix: skip route-resolution for server-side auth commands; pass key_spec not loaded key
Testing / test (push) Failing after 14m2s
browser-cli.auth.keys and browser-cli.auth.trust are handled by serve.py
directly and never need a _route profile, so they no longer trigger
_auto_route_remote (which would open a second connection just to discover
available browser profiles).

Also fixes _auto_route_remote receiving an already-loaded AgentKey object
instead of the key spec string — the nested send_command call couldn't
re-load it for signing, causing auth failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 20:03:50 +02:00
daniel156161 b87f536ecd chore: bump version to 0.9.1
Testing / test (push) Failing after 11m6s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 19:56:39 +02:00
daniel156161 a2aa031d71 feat: auth keys shows trusted keys with names; remote auth trust/keys
- authorized_keys format extended to '<hex> [optional-name]'
- auth keys repurposed: shows server's trusted keys (Name/Public Key table)
  instead of local client keys; --remote queries the remote serve instance
- auth trust gains --name flag for labelling keys; --remote pushes the key
  to the remote server's authorized_keys
- serve.py handles browser-cli.auth.keys and browser-cli.auth.trust as
  server-side commands (authenticated, never forwarded to native host)
- serve.py reloads authorized_keys from disk on every connection so
  auth trust --remote takes effect immediately without restarting serve
- auth show unchanged: still prints your own client public key

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 19:54:41 +02:00
daniel156161 8593916e5a fix: propagate key through remote discovery; auto-persist key per remote
- remote_browser_targets(), _auto_route_remote(), active_browser_targets()
  now accept and forward the key parameter so pubkey auth works during
  the initial browser-cli.targets discovery call
- _multi_browser_targets() in tabs/groups/windows/session commands now
  reads key from ctx.obj and passes it through
- send_command() auto-saves the key spec (e.g. "agent") to remotes.json
  on first explicit use; subsequent calls to the same remote reuse it
  without requiring --key every time
- Added save_remote_key() / key_for_remote() helpers (mirrors token helpers)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 19:50:51 +02:00
daniel156161 4b2abbbfc5 feat: Ed25519 challenge-response auth + YubiKey/SSH agent support (v0.9.0)
Testing / test (push) Successful in 26s
Package Extension / package-extension (push) Successful in 22s
Build & Publish Package / publish (push) Successful in 27s
Security:
- serve.py: server now sends nonce challenge before accepting any command;
  clients sign nonce + SHA256(canonical_payload) with Ed25519 key
- New --authorized-keys FILE option for serve; token auth still works as fallback
- Connection limit: BoundedSemaphore(64) in serve.py
- Secure file creation with os.open(..., 0o600) for token/key files
- New auth.py module: keygen, file key load/save, SSH agent protocol (pure Python),
  sign/verify helpers compatible with both file keys and agent-held keys (YubiKey,
  TPM, gpg-agent)

Features:
- YubiKey support via SSH agent protocol — no new runtime deps, just $SSH_AUTH_SOCK
- New `browser-cli auth` command group: keygen, trust, show, keys
- Global --key PATH flag (or BROWSER_CLI_KEY env) selects signing key;
  pass "agent" or "agent:<selector>" to use SSH agent key
- BrowserCLI Python API gains key= parameter

Bug fixes (11 issues across two review passes):
- client.py: check response is not None before json.loads
- native_host.py: _read_exact_stream loop handles EINTR short reads; fix Windows
  Listener leak on accept error
- __init__.py: open_wait / tabs_watch_url raise RuntimeError instead of silent None
- extension/tabs.ts: dedupe skips tabs without URL; tabsSort uses pendingUrl fallback
- extension/session.ts: removeListener before addListener prevents duplicate handlers

Breaking: TCP serve protocol now sends a challenge frame first (v0.9.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.9.0
2026-05-02 16:20:39 +02:00
daniel156161 9f03e29807 chore: bump version to 0.8.7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 15:05:51 +02:00
daniel156161 e1ff67e259 chore: bump npm devDependencies to latest
@types/chrome 0.0.326 → 0.1.40
esbuild 0.25.12 → 0.28.0
typescript 5.9.3 → 6.0.3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 15:04:20 +02:00
daniel156161 a8421e97f5 fix: harden IPC, screenshot, paging, and tab filter error handling
- tabs.py: validate screenshot data URL prefix and catch binascii.Error
  instead of silently writing a zero-byte file or crashing with a raw traceback
- serve.py: add 30 s recv timeout on client connections to prevent unbounded
  thread accumulation; use hmac.compare_digest for constant-time token check
- native_host.py: bind Unix socket before _registry_add to eliminate the
  window where the registry points to an unbound path; cap paging loop at
  ceil(10000/PAGE_SIZE) iterations to guard against a misbehaving extension;
  remove dead no-hello fast-path queue that was registered but never consumed
- __init__.py: narrow _apply_tab_filter except to (AttributeError, TypeError)
  so broken filter functions raise instead of silently returning wrong results

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 15:03:01 +02:00
daniel156161 753e4c4449 update version to 0.8.6 and update requirements
Testing / test (push) Successful in 23s
Package Extension / package-extension (push) Successful in 21s
Build & Publish Package / publish (push) Successful in 22s
v0.8.6
2026-05-02 12:44:54 +02:00
daniel156161 f1734cd2c1 make remote browser listing more simpler when giving --browser ip only shows remote browsers
Testing / test (push) Successful in 22s
2026-05-02 12:42:21 +02:00
daniel156161 22f39a1a77 fix echo of versions that uv not shows uv uv 0.9.29 and look more normal like uv 0.9.29
Testing / test (push) Successful in 37s
2026-05-02 12:26:23 +02:00
daniel156161 a9071abc9a cleanup tests
Package Extension / package-extension (push) Successful in 24s
Build & Publish Package / publish (push) Successful in 31s
Testing / test (push) Successful in 26s
v0.8.5
2026-05-02 01:48:13 +02:00
daniel156161 edafd349df use full terminal columns for completion test and add native host app as a single script wraper for native host app import 2026-05-02 01:14:28 +02:00
daniel156161 9435dcc716 target first remote browser when not giving it with a alias and update version to 0.8.4
Testing / test (push) Successful in 34s
Package Extension / package-extension (push) Successful in 1m0s
Build & Publish Package / publish (push) Successful in 37s
v0.8.4
2026-05-01 20:14:40 +02:00
daniel156161 bd37c68e80 fix bug that getAliases got not found and update version to 0.8.3
Testing / test (push) Successful in 26s
2026-05-01 20:04:34 +02:00
daniel156161 ffa76f424a implement same functionality into BrowserCLI python package 2026-05-01 20:01:55 +02:00
daniel156161 647867d05e make it easyer to connect to a remove browser allow it with --browser ip alias too
Testing / test (push) Failing after 13m59s
2026-05-01 19:55:02 +02:00
daniel156161 f836844791 run nm ci when not already installed into repository folder
Testing / test (push) Failing after 14m20s
2026-05-01 19:44:18 +02:00
daniel156161 6f7c4fc7ea add nix shell file to build background.js
Testing / test (push) Failing after 14m25s
2026-05-01 19:39:33 +02:00
daniel156161 1b0e090466 update version to 0.8.2
Testing / test (push) Failing after 12m47s
2026-05-01 19:30:29 +02:00
daniel156161 d904f4ca63 move registry into own files 2026-05-01 19:30:09 +02:00
daniel156161 7ee664153b change background.js into split typescript files for better managemand and build background.js from typescript 2026-05-01 19:28:36 +02:00
daniel156161 fb78fd0471 impplement pageing between native host and browser extension 2026-05-01 19:07:46 +02:00
daniel156161 5ff340a6d3 allow to ask for remote host profiles and save token on first connection for later use 2026-05-01 19:07:04 +02:00
daniel156161 2f982fa714 fix remote clients command
Testing / test (push) Successful in 25s
Package Extension / package-extension (push) Successful in 9s
Build & Publish Package / publish (push) Successful in 21s
v0.8.1
2026-04-30 13:49:32 +02:00
daniel156161 6785b9f70c feat(serve): add remote browser control over TCP with token auth
Build & Publish Package / publish (push) Successful in 50s
Testing / test (push) Successful in 31s
Package Extension / package-extension (push) Successful in 27s
Exposes a local browser over a TCP socket so remote machines can
  control it using the same CLI and Python API. Token auth (auto-generated
  via secrets.token_urlsafe) is on by default; --no-auth disables it.
  Profile routing via _route message field lets clients target specific
  browser instances on the remote host. BROWSER_CLI_PROFILE is forwarded
  automatically so --browser flag works transparently over remote.
  - browser-cli serve [--host] [--port] [--token] [--no-auth]
  - browser-cli --remote HOST:PORT --token TOKEN <command>
  - BrowserCLI(remote="host:port", token="...").tabs_list()
v0.8.0
2026-04-25 18:33:59 +02:00
daniel156161 1bf44c0eef update uv lock file
Testing / test (push) Successful in 28s
Package Extension / package-extension (push) Successful in 14s
Build & Publish Package / publish (push) Successful in 26s
v0.7.1
2026-04-17 21:09:27 +02:00
daniel156161 cf0c9555d0 update version to 0.7.1
Testing / test (push) Successful in 28s
Package Extension / package-extension (push) Successful in 13s
Build & Publish Package / publish (push) Successful in 31s
2026-04-17 21:08:18 +02:00
daniel156161 a7da6cfab0 hardcode extension id and not prompt user
Testing / test (push) Has been cancelled
2026-04-17 21:07:30 +02:00
daniel156161 88b4f5ed11 add key generation script 2026-04-17 21:06:52 +02:00
daniel156161 36abde501c update version to 0.7.0
Testing / test (push) Successful in 23s
Package Extension / package-extension (push) Successful in 21s
Build & Publish Package / publish (push) Successful in 24s
v0.7.0
2026-04-17 20:52:47 +02:00
daniel156161 1aff084429 add deterministic extension key
Testing / test (push) Waiting to run
Extension ID: bfpmkhngkjnfhabmfckgeohlilokodkg
2026-04-17 20:45:36 +02:00
daniel156161 1c5fd0ffee feat: add browser automation commands (v0.6.0)
Testing / test (push) Successful in 24s
Package Extension / package-extension (push) Successful in 9s
Build & Publish Package / publish (push) Successful in 21s
Navigation: open-wait (open + block until loaded)
DOM: key, hover, check/uncheck, clear, focus, submit, poll, scroll, select, eval, wait-for
Tabs: pin/unpin, screenshot, watch-url (block until URL matches regex)
New command groups: page info, storage get/set, cookies list/get/set
Extension: add cookies permission
v0.6.0
2026-04-16 14:21:19 +02:00
daniel156161 fc4ce8f74d rename Chrome to Browser
Testing / test (push) Successful in 20s
2026-04-16 11:55:09 +02:00
daniel156161 cd2ebc2982 set defaults to tab empyt url and title with muted false
Testing / test (push) Successful in 31s
2026-04-14 13:21:21 +02:00
daniel156161 edf9056430 show mute status correctly when tab mute and add to get single tab status
Package Extension / package-extension (push) Successful in 17s
Build & Publish Package / publish (push) Successful in 29s
Testing / test (push) Failing after 26s
v0.5.12
2026-04-13 21:35:25 +02:00