@@ -222,6 +222,8 @@ public static void RunParser(string[] args)
222222 var isCopilot = false ;
223223 var parsedData = false ;
224224 var ignoreStartup = false ;
225+ var collectSingleArgument = false ;
226+ var singleArgument = string . Empty ;
225227 var p = new Process ( ) ;
226228 p . StartInfo . UseShellExecute = true ;
227229 p . StartInfo . RedirectStandardOutput = false ;
@@ -235,6 +237,13 @@ public static void RunParser(string[] args)
235237
236238 foreach ( var arg in args )
237239 {
240+ if ( collectSingleArgument )
241+ {
242+ // Concatenate all remaining arguments into a single string
243+ singleArgument += ( singleArgument . Length > 0 ? " " : "" ) + arg ;
244+ continue ;
245+ }
246+
238247 // Check for Copilot
239248 if ( arg . Contains ( "microsoft-edge://?ux=copilot&tcp=1&source=taskbar" )
240249 || arg . Contains ( "microsoft-edge:///?ux=copilot&tcp=1&source=taskbar" ) )
@@ -262,8 +271,18 @@ public static void RunParser(string[] args)
262271 if ( arg . Contains ( "--no-startup-window" )
263272 || arg . Contains ( "--profile-directory" ) )
264273 ignoreStartup = true ;
274+
275+ // Check for the single argument flag
276+ if ( arg == "--single-argument" )
277+ {
278+ collectSingleArgument = true ;
279+ }
265280 }
266281
282+ // Validate single argument
283+ if ( File . Exists ( singleArgument ) )
284+ isFile = true ;
285+
267286 // Open Edge normally
268287 if ( ( ! parsedData || isCopilot || isFile || args . Contains ( "--profile-directory" ) ) && ! ignoreStartup )
269288 {
@@ -282,7 +301,7 @@ public static void RunParser(string[] args)
282301 messageUi . ShowDialog ( ) ;
283302 }
284303 }
285- var parsedArgs = args . Skip ( 2 ) ;
304+ var parsedArgs = args . Skip ( 1 ) ;
286305 p . StartInfo . FileName = FileConfiguration . NonIfeoPath ;
287306 p . StartInfo . Arguments = string . Join ( " " , parsedArgs ) ;
288307 p . Start ( ) ;
0 commit comments