fix(cli,js): add --version flag and script-error-resilience test (#147)
Two improvements while investigating #147: 1. `obscura --version` / `-V` now print the CARGO_PKG_VERSION instead of erroring out. The issue reporter explicitly called out that there was no version flag, and the existing `obscura serve` banner is the only way to discover the version. 2. New regression test in obscura-js verifies that a TypeError thrown from one script does not poison the runtime: subsequent scripts and DOM queries must continue to work. The reporter's symptom was that offside.js crashing collapsed --dump text output to 1 byte; that cascade should never happen and this test pins it down. The classList error itself is offside.js's own bug (it indexes into the querySelectorAll result without checking for an empty array) and only fires when the .slideout-navigation element is absent from the DOM. On current main that element parses correctly and offside.js runs without error against a captured copy of the affected page.
This commit is contained in:
1 parent
8cb0cb429b
commit
935cb5c0da
2 files changed
+36
-1
No files matched your search
@@ -8,7 +8,11 @@ use tokio::process::Command as TokioCommand;
|
||||
use tokio::time::{timeout, Duration};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "obscura", about = "Obscura - A lightweight headless browser for web scraping and automation")]
|
||||
#[command(
|
||||
name = "obscura",
|
||||
version = env!("CARGO_PKG_VERSION"),
|
||||
about = "Obscura - A lightweight headless browser for web scraping and automation",
|
||||
)]
|
||||
struct Args {
|
||||
#[arg(short, long, global = true)]
|
||||
verbose: bool,
|
||||
|
||||
Reference in new issue
Block a user