feat: add support for ignoring HTTPS certificate errors (#93)

* feat: add support for ignoring HTTPS certificate errors

* fix: update warning message for already running daemon to include ignore HTTPS errors option

* docs: add documentation for --ignore-https-errors option in README and SKILL.md

* feat: initialize ignore_https_errors flag in command context

* fix: change launch_cmd to mutable for cdp value handling
This commit is contained in:
Zhiwei Li
2026-01-24 23:54:33 -06:00
committed by GitHub
parent 60534dfd63
commit 53187a603c
12 changed files with 65 additions and 2 deletions
+15 -1
View File
@@ -200,6 +200,7 @@ fn main() {
flags.user_agent.as_deref(),
flags.proxy.as_deref(),
flags.proxy_bypass.as_deref(),
flags.ignore_https_errors,
) {
Ok(result) => result,
Err(e) => {
@@ -223,6 +224,7 @@ fn main() {
flags.user_agent.as_ref().map(|_| "--user-agent"),
flags.proxy.as_ref().map(|_| "--proxy"),
flags.proxy_bypass.as_ref().map(|_| "--proxy-bypass"),
flags.ignore_https_errors.then(|| "--ignore-https-errors"),
]
.into_iter()
.flatten()
@@ -235,6 +237,10 @@ fn main() {
ignored_flags.join(", ")
);
}
if flags.ignore_https_errors {
eprintln!("{} --ignore-https-errors ignored: daemon already running. Use 'agent-browser close' first to restart with this option.", color::warning_indicator());
}
}
// Validate mutually exclusive options
@@ -261,7 +267,7 @@ fn main() {
// Connect via CDP if --cdp flag is set
// Accepts either a port number (e.g., "9222") or a full URL (e.g., "ws://..." or "wss://...")
if let Some(ref cdp_value) = flags.cdp {
let launch_cmd = if cdp_value.starts_with("ws://")
let mut launch_cmd = if cdp_value.starts_with("ws://")
|| cdp_value.starts_with("wss://")
|| cdp_value.starts_with("http://")
|| cdp_value.starts_with("https://")
@@ -317,6 +323,10 @@ fn main() {
})
};
if flags.ignore_https_errors {
launch_cmd["ignoreHTTPSErrors"] = json!(true);
}
let err = match send_command(launch_cmd, &flags.session) {
Ok(resp) if resp.success => None,
Ok(resp) => Some(
@@ -401,6 +411,10 @@ fn main() {
cmd_obj.insert("args".to_string(), json!(args_vec));
}
if flags.ignore_https_errors {
launch_cmd["ignoreHTTPSErrors"] = json!(true);
}
if let Err(e) = send_command(launch_cmd, &flags.session) {
if !flags.json {
eprintln!("{} Could not configure browser: {}", color::warning_indicator(), e);