Skip to content

Releases: lipex360x/web-view

v0.7.0 — eval --js-file + stdin

Choose a tag to compare

@lipex360x lipex360x released this 18 Jun 13:57
ade1042

Added

  • web-view eval --js-file <path> and stdin (--js -)eval can now take its JavaScript expression from a file or from stdin, not only inline --js "<expr>". --js and --js-file are a required, mutually exclusive group; a missing --js-file errors on stderr and exits 1. Lets reusable multi-line .js snippets run natively through the CLI and compose with pipes (cat find-media.js | web-view eval --js - --frame index_lms). Closes #17.

Install / upgrade: uv tool install --reinstall "git+https://github.com/lipex360x/web-view@v0.7.0".

Full changelog: https://github.com/lipex360x/web-view/blob/main/CHANGELOG.md

v0.6.0 — iframe support

Choose a tag to compare

@lipex360x lipex360x released this 18 Jun 11:30
5497f34

Iframe support (#11): see and act inside same-origin iframes, plus two new escape-hatch verbs. Three additive, backward-compatible parts.

Added

  • web-view snap recurses into same-origin iframes (library: cdp.aria_snapshot(page, include_frames=True)). Each - iframe leaf is expanded in place: same-origin frames have their accessibility tree inlined under the node, labelled with the frame URL; cross-origin frames are annotated - iframe (cross-origin, not captured). --no-frames (library include_frames=False) keeps the legacy top-frame output.
  • --frame selector for web-view do <verb> — every element-targeting verb (click, fill, check, hover, dblclick, right-click, scroll-into-view, upload, drag) can act on an element inside an iframe. Grammar mirrors --tab: index (--frame 1, 0 is the top frame), URL substring (--frame index_lms), or auto (default). auto cheap-probes with a non-waiting .count(), so it never multiplies --timeout across frames. press is excluded by design (keyboard input is frame-agnostic).
  • web-view eval --js "<expr>" (library: cdp.evaluate(root, expression)) runs JS in a tab or frame and prints the result as JSON; a non-serialisable result exits 1 with a structured error.
  • web-view download --url <u> --out <path> (library: cdp.download_resource(context, source_url, destination)) fetches through the browser context (cookies reused), prints HTTP status + byte count, and exits 1 on a non-2xx status.

cdp.evaluate and cdp.download_resource are exported in web_view.cdp.__all__.

Install / upgrade: uv tool upgrade web-view (or uv tool install --reinstall git+https://github.com/lipex360x/web-view@v0.6.0).

Full changelog: https://github.com/lipex360x/web-view/blob/main/CHANGELOG.md

v0.5.0 — version flag

Choose a tag to compare

@lipex360x lipex360x released this 18 Jun 11:03

Added

web-view --version / -v — print the installed version and exit. Resolved from the installed package metadata (importlib.metadata), so it always matches the distribution actually on PATH rather than a hardcoded string.

v0.4.0 — tab management

Choose a tag to compare

@lipex360x lipex360x released this 18 Jun 10:56
ece5050

Added

web-view tab new/close/switch — tab-lifecycle CLI family under a single tab parent.

  • tab new [--url] opens a tab (about:blank by default).
  • tab close --tab <index|substring> closes a tab. --tab is required because closing is destructive (no implicit default).
  • tab switch [--tab <index|substring>] brings a tab to the front; defaults to the first non-helper tab.

Every verb accepts --port (auto-resolves like navigate/snap/stop) and --quiet/-q. Tab selection mirrors navigate (0-based index, negatives allowed, or URL substring). Thin pass-through over the existing cdp.open_tab / cdp.close_tab / cdp.switch_to_tab helpers. Root command list now at 8 (the ADR 0001 cap).

Closes #9.

v0.3.0 — window resize CLI

Choose a tag to compare

@lipex360x lipex360x released this 28 May 13:28
e9cfc09

Adds window-resize capability to the web-view CLI and library. Closes #8.

What's new

# pre-launch — initial window size (replaces the previously hardcoded 1920x1080)
web-view start --window-size 1280x720

# post-launch — resize a running Chrome (OS window, default)
web-view resize --width 1280 --height 720

# page-viewport override only (does not touch the OS window)
web-view resize --width 800 --height 600 --viewport

Every other runtime flag follows the existing patterns: --port auto-resolves when a single CDP Chrome is running, --tab <index|substring> reuses navigate semantics, --quiet/-q silences the one-line success ack.

Library helpers

New cdp/_window.py module:

cdp.set_window_size(page, *, width=1280, height=720)
# OS-level resize via CDP Browser.setWindowBounds. The user sees the
# Chrome window physically change size on their desktop.

cdp.set_viewport(page, *, width=1280, height=720)
# Page-rendering viewport override via Playwright's set_viewport_size.
# Useful for responsive-layout testing without touching the OS window.

cdp.start_chrome now accepts window_size=(W, H) to control the initial size.

Surface

  • Root web-view -h lists 7 commands (start | list | stop | navigate | snap | do | resize) — under the 8-command cap from ADR 0001.
  • Per-command help: web-view resize -h carries Examples + Port-selection + Tab-selection + Persistence-behaviour blocks.

Install

uv tool install --reinstall git+https://github.com/lipex360x/web-view@v0.3.0

Or upgrade an existing install:

uv tool upgrade web-view

What's next

Issue #9 — tab management (web-view tab new/close/switch). Library helpers already exist (cdp.open_tab / close_tab / switch_to_tab); only CLI surface is missing. Targets v0.4.0.

v0.2.0 — `web-view do <verb>` element interaction

Choose a tag to compare

@lipex360x lipex360x released this 28 May 11:42
a9e36b3

Phase B of #4 ships. Adds the web-view do <verb> element-interaction CLI family per ADR 0001.

What's new

web-view do click       --role button   --name "Next slide"
web-view do fill        --role textbox  --name "Email"  --value "x@y.com"
web-view do fill        --role textbox  --name "Body"   < message.txt
web-view do check       --role checkbox --name "Remember me"
web-view do press       --keys "Control+a,Backspace"
web-view do hover       --role button   --name "Tooltip"
web-view do dblclick    --role link     --name "Open"
web-view do right-click --role cell     --name "A1"
web-view do scroll-into-view --role region --name "Footer"
web-view do upload      --role button   --name "Choose file" --file ./report.pdf
web-view do drag        --from "button:Item" --to "region:Trash"

Every verb accepts the same options: --port/--tab for instance + tab targeting (same semantics as web-view navigate), --timeout for the upper bound on element waits (default 15s), --quiet/-q to silence the one-line success ack. CSS-first workflows use --selector <css> as a mutually exclusive alternative to --role/--name.

Why this matters

Closes the read-yaml → act loop:

web-view snap login                                       # produces 01-login.aria.yaml
# YAML shows: `- button "Sign in"`, `- textbox "Email"`
web-view do fill --role textbox --name "Email" --value "alice@example.com"
web-view do click --role button --name "Sign in"
web-view snap after-login                                 # captures the new state

No Python REPL escape needed for the common "click this thing" path.

Surface

  • Root web-view -h stays terse: 6 commands (start | list | stop | navigate | snap | do).
  • Discovery for the interaction verbs: web-view do -h.
  • Per-verb help: web-view do <verb> -h carries Examples + addressing + port/tab notes.

Install

uv tool install --reinstall git+https://github.com/lipex360x/web-view@v0.2.0

Or upgrade an existing install:

uv tool upgrade web-view

Out of scope (deferred)

  • evaluate — needs library work in cdp.py first plus its own design pass for JSON-serialisation and JS-input encoding. Will land as a follow-up issue.

v0.1.0 — initial baseline

Choose a tag to compare

@lipex360x lipex360x released this 28 May 11:27
7cbdeb0

First tagged release. Captures the post-refactor stable surface.

CLI commands

  • web-view start [--url URL] [--port N] [--headed]
  • web-view list
  • web-view stop [--port N] (auto-resolves when a single instance is running)
  • web-view navigate --url URL [--port N] [--tab INDEX_OR_SUBSTRING] [--new-tab]
  • web-view snap [SLUG] [--port N] [--url-contains S] [--destination-dir DIR]

web-view -h follows the git / docker / gh market-standard terse top-level pattern; per-command -h carries Examples, Port selection, Tab selection, and Error contract blocks.

Library

from web_view import cdp exposes the full helper surface (lifecycle, connection, navigation, interaction, files, state, snapshots, console, network) — now organised as a package with shared helpers under _shared.

Highlights since initial commit

  • PR #2 — split cdp.py and cli.py into packages; introduced navigate; applied market-standard -h.
  • PR #3--port is optional in navigate / snap / stop (auto-resolves the single instance).
  • PR #5 — ADR 0001 records the design decision for the upcoming web-view do <verb> interaction CLI (Phase A of #4).

Install

uv tool install --reinstall git+https://github.com/lipex360x/web-view@v0.1.0

What's next

Phase B of #4 — implement web-view do click / fill / press / hover / dblclick / right-click / scroll-into-view / upload / drag on the feat/cli-interaction-4 branch. Targets v0.2.0.