@@ -12,6 +12,7 @@ const PROJECT_CONFIG_FILENAME: &str = "agent-browser.json";
1212#[ serde( default , rename_all = "camelCase" ) ]
1313pub struct Config {
1414 pub headed : Option < bool > ,
15+ pub no_activate : Option < bool > ,
1516 pub json : Option < bool > ,
1617 pub full : Option < bool > ,
1718 pub debug : Option < bool > ,
@@ -49,6 +50,7 @@ impl Config {
4950 fn merge ( self , other : Config ) -> Config {
5051 Config {
5152 headed : other. headed . or ( self . headed ) ,
53+ no_activate : other. no_activate . or ( self . no_activate ) ,
5254 json : other. json . or ( self . json ) ,
5355 full : other. full . or ( self . full ) ,
5456 debug : other. debug . or ( self . debug ) ,
@@ -211,6 +213,7 @@ pub struct Flags {
211213 pub json : bool ,
212214 pub full : bool ,
213215 pub headed : bool ,
216+ pub no_activate : bool ,
214217 pub debug : bool ,
215218 pub session : String ,
216219 pub headers : Option < String > ,
@@ -283,6 +286,8 @@ pub fn parse_flags(args: &[String]) -> Flags {
283286 json : env_var_is_truthy ( "AGENT_BROWSER_JSON" ) || config. json . unwrap_or ( false ) ,
284287 full : env_var_is_truthy ( "AGENT_BROWSER_FULL" ) || config. full . unwrap_or ( false ) ,
285288 headed : env_var_is_truthy ( "AGENT_BROWSER_HEADED" ) || config. headed . unwrap_or ( false ) ,
289+ no_activate : env_var_is_truthy ( "AGENT_BROWSER_NO_ACTIVATE" )
290+ || config. no_activate . unwrap_or ( false ) ,
286291 debug : env_var_is_truthy ( "AGENT_BROWSER_DEBUG" ) || config. debug . unwrap_or ( false ) ,
287292 session : env:: var ( "AGENT_BROWSER_SESSION" )
288293 . ok ( )
@@ -385,6 +390,13 @@ pub fn parse_flags(args: &[String]) -> Flags {
385390 i += 1 ;
386391 }
387392 }
393+ "--no-activate" => {
394+ let ( val, consumed) = parse_bool_arg ( args, i) ;
395+ flags. no_activate = val;
396+ if consumed {
397+ i += 1 ;
398+ }
399+ }
388400 "--debug" => {
389401 let ( val, consumed) = parse_bool_arg ( args, i) ;
390402 flags. debug = val;
@@ -606,6 +618,7 @@ pub fn clean_args(args: &[String]) -> Vec<String> {
606618 "--json" ,
607619 "--full" ,
608620 "--headed" ,
621+ "--no-activate" ,
609622 "--debug" ,
610623 "--ignore-https-errors" ,
611624 "--allow-file-access" ,
@@ -1113,6 +1126,12 @@ mod tests {
11131126 assert ! ( flags. headed) ;
11141127 }
11151128
1129+ #[ test]
1130+ fn test_no_activate_bare_defaults_true ( ) {
1131+ let flags = parse_flags ( & args ( "--no-activate open example.com" ) ) ;
1132+ assert ! ( flags. no_activate) ;
1133+ }
1134+
11161135 #[ test]
11171136 fn test_debug_false ( ) {
11181137 let flags = parse_flags ( & args ( "--debug false open example.com" ) ) ;
@@ -1186,6 +1205,12 @@ mod tests {
11861205 assert_eq ! ( cleaned, vec![ "open" , "example.com" ] ) ;
11871206 }
11881207
1208+ #[ test]
1209+ fn test_clean_args_removes_no_activate ( ) {
1210+ let cleaned = clean_args ( & args ( "--no-activate open example.com" ) ) ;
1211+ assert_eq ! ( cleaned, vec![ "open" , "example.com" ] ) ;
1212+ }
1213+
11891214 // === Extensions merge tests ===
11901215
11911216 #[ test]
0 commit comments