fix: reject invalid --headers JSON, empty frame commands, and --cdp + --extension combo (#488)
## Summary
- Return a `ParseError` when `--headers` receives invalid JSON instead of silently dropping the headers and proceeding
- Reject `frame` commands that provide no `selector`, `name`, or `url` (previously returned `{ switched: true }` without doing anything)
- Add missing mutual exclusion check for `--cdp` + `--extension` (extensions require a local browser, not a CDP connection)
This commit is contained in:
@@ -336,6 +336,16 @@ fn main() {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if flags.cdp.is_some() && !flags.extensions.is_empty() {
|
||||
let msg = "Cannot use --extension with --cdp (extensions require local browser)";
|
||||
if flags.json {
|
||||
println!(r#"{{"success":false,"error":"{}"}}"#, msg);
|
||||
} else {
|
||||
eprintln!("{} {}", color::error_indicator(), msg);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Auto-connect to existing browser
|
||||
if flags.auto_connect {
|
||||
let mut launch_cmd = json!({
|
||||
|
||||
Reference in New Issue
Block a user