merge: sync upstream/main into fork main
This commit is contained in:
+7
-1
@@ -1,6 +1,12 @@
|
|||||||
# agent-browser
|
# agent-browser
|
||||||
|
|
||||||
## 0.14.0-fork.3
|
## 0.15.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 7bd8ce9: Added support for chrome:// and chrome-extension:// URLs in navigation and recording commands. These special browser URLs are now preserved as-is instead of having https:// incorrectly prepended.
|
||||||
|
|
||||||
|
## 0.15.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -4,7 +4,7 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "agent-browser-stealth"
|
name = "agent-browser-stealth"
|
||||||
version = "0.14.0-fork.6"
|
version = "0.15.1-fork.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"dirs",
|
"dirs",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "agent-browser-stealth"
|
name = "agent-browser-stealth"
|
||||||
version = "0.14.0-fork.6"
|
version = "0.15.1-fork.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Stealth browser automation CLI for AI agents with anti-bot evasions"
|
description = "Stealth browser automation CLI for AI agents with anti-bot evasions"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
+40
-4
@@ -159,6 +159,8 @@ pub fn parse_command(args: &[String], flags: &Flags) -> Result<Value, ParseError
|
|||||||
|| url_lower.starts_with("about:")
|
|| url_lower.starts_with("about:")
|
||||||
|| url_lower.starts_with("data:")
|
|| url_lower.starts_with("data:")
|
||||||
|| url_lower.starts_with("file:")
|
|| url_lower.starts_with("file:")
|
||||||
|
|| url_lower.starts_with("chrome-extension://")
|
||||||
|
|| url_lower.starts_with("chrome://")
|
||||||
{
|
{
|
||||||
url.to_string()
|
url.to_string()
|
||||||
} else {
|
} else {
|
||||||
@@ -994,8 +996,8 @@ pub fn parse_command(args: &[String], flags: &Flags) -> Result<Value, ParseError
|
|||||||
let url = rest.get(2);
|
let url = rest.get(2);
|
||||||
let mut cmd = json!({ "id": id, "action": "recording_start", "path": path });
|
let mut cmd = json!({ "id": id, "action": "recording_start", "path": path });
|
||||||
if let Some(u) = url {
|
if let Some(u) = url {
|
||||||
// Add https:// prefix if needed
|
// Add https:// prefix if needed (preserve special schemes)
|
||||||
let url_str = if u.starts_with("http") {
|
let url_str = if u.starts_with("http") || u.contains("://") {
|
||||||
u.to_string()
|
u.to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("https://{}", u)
|
format!("https://{}", u)
|
||||||
@@ -1014,8 +1016,8 @@ pub fn parse_command(args: &[String], flags: &Flags) -> Result<Value, ParseError
|
|||||||
let url = rest.get(2);
|
let url = rest.get(2);
|
||||||
let mut cmd = json!({ "id": id, "action": "recording_restart", "path": path });
|
let mut cmd = json!({ "id": id, "action": "recording_restart", "path": path });
|
||||||
if let Some(u) = url {
|
if let Some(u) = url {
|
||||||
// Add https:// prefix if needed
|
// Add https:// prefix if needed (preserve special schemes)
|
||||||
let url_str = if u.starts_with("http") {
|
let url_str = if u.starts_with("http") || u.contains("://") {
|
||||||
u.to_string()
|
u.to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("https://{}", u)
|
format!("https://{}", u)
|
||||||
@@ -2362,6 +2364,28 @@ mod tests {
|
|||||||
assert!(msg.contains("Invalid JSON for --headers"));
|
assert!(msg.contains("Invalid JSON for --headers"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_navigate_chrome_extension_url() {
|
||||||
|
let cmd = parse_command(
|
||||||
|
&args("open chrome-extension://abcdefghijklmnop/popup.html"),
|
||||||
|
&default_flags(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(cmd["action"], "navigate");
|
||||||
|
assert_eq!(
|
||||||
|
cmd["url"],
|
||||||
|
"chrome-extension://abcdefghijklmnop/popup.html"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_navigate_chrome_url() {
|
||||||
|
let cmd =
|
||||||
|
parse_command(&args("open chrome://extensions"), &default_flags()).unwrap();
|
||||||
|
assert_eq!(cmd["action"], "navigate");
|
||||||
|
assert_eq!(cmd["url"], "chrome://extensions");
|
||||||
|
}
|
||||||
|
|
||||||
// === Set Headers Tests ===
|
// === Set Headers Tests ===
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -2740,6 +2764,18 @@ mod tests {
|
|||||||
assert_eq!(cmd["url"], "https://example.com");
|
assert_eq!(cmd["url"], "https://example.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_record_start_with_chrome_extension_url() {
|
||||||
|
let cmd = parse_command(
|
||||||
|
&args("record start demo.webm chrome-extension://abcdef/popup.html"),
|
||||||
|
&default_flags(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(cmd["action"], "recording_start");
|
||||||
|
assert_eq!(cmd["path"], "demo.webm");
|
||||||
|
assert_eq!(cmd["url"], "chrome-extension://abcdef/popup.html");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_record_start_missing_path() {
|
fn test_record_start_missing_path() {
|
||||||
let result = parse_command(&args("record start"), &default_flags());
|
let result = parse_command(&args("record start"), &default_flags());
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "agent-browser-stealth",
|
"name": "agent-browser-stealth",
|
||||||
"version": "0.14.0-fork.6",
|
"version": "0.15.1-fork.6",
|
||||||
"description": "Stealth browser automation CLI for AI agents with anti-bot evasions",
|
"description": "Stealth browser automation CLI for AI agents with anti-bot evasions",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/daemon.js",
|
"main": "dist/daemon.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user