@@ -38,7 +38,7 @@ private static string GetDefaultBrowserPath()
3838 /// Opens search in a new browser. If no browser path is passed in then Chrome is used.
3939 /// Leave browser path blank to use Chrome.
4040 /// </summary>
41- public static void OpenInBrowserWindow ( this string url , string browserPath = "" , bool inPrivate = false , string privateArg = "" )
41+ public static void OpenInBrowserWindow ( this string url , string browserPath = "" , bool inPrivate = false , string privateArg = "" , string extraArgs = "" )
4242 {
4343 browserPath = string . IsNullOrEmpty ( browserPath ) ? GetDefaultBrowserPath ( ) : browserPath ;
4444
@@ -52,12 +52,15 @@ public static void OpenInBrowserWindow(this string url, string browserPath = "",
5252 var browser = string . IsNullOrEmpty ( browserExecutableName ) ? "chrome" : browserPath ;
5353
5454 // Internet Explorer will open url in new browser window, and does not take the --new-window parameter
55- var browserArguements = ( browserExecutableName == "iexplore.exe" ? "" : "--new-window " ) + ( inPrivate ? $ "{ privateArg } " : "" ) + url ;
55+ var browserArguments = ( browserExecutableName == "iexplore.exe" ? "" : "--new-window " )
56+ + ( inPrivate ? $ "{ privateArg } " : "" )
57+ + ( string . IsNullOrWhiteSpace ( extraArgs ) ? "" : $ "{ extraArgs } ")
58+ + url ;
5659
5760 var psi = new ProcessStartInfo
5861 {
5962 FileName = browser ,
60- Arguments = browserArguements ,
63+ Arguments = browserArguments ,
6164 UseShellExecute = true
6265 } ;
6366
@@ -86,7 +89,7 @@ public static void OpenInBrowserWindow(this string url, string browserPath = "",
8689 /// <summary>
8790 /// Opens search as a tab in the default browser chosen in Windows settings.
8891 /// </summary>
89- public static void OpenInBrowserTab ( this string url , string browserPath = "" , bool inPrivate = false , string privateArg = "" )
92+ public static void OpenInBrowserTab ( this string url , string browserPath = "" , bool inPrivate = false , string privateArg = "" , string extraArgs = "" )
9093 {
9194 browserPath = string . IsNullOrEmpty ( browserPath ) ? GetDefaultBrowserPath ( ) : browserPath ;
9295
@@ -99,7 +102,9 @@ public static void OpenInBrowserTab(this string url, string browserPath = "", bo
99102 if ( ! string . IsNullOrEmpty ( browserPath ) )
100103 {
101104 psi . FileName = browserPath ;
102- psi . Arguments = ( inPrivate ? $ "{ privateArg } " : "" ) + url ;
105+ psi . Arguments = ( inPrivate ? $ "{ privateArg } " : "" )
106+ + ( string . IsNullOrWhiteSpace ( extraArgs ) ? "" : $ "{ extraArgs } ")
107+ + url ;
103108 }
104109 else
105110 {
0 commit comments