Invoke default browser on Windows
This commit is contained in:
parent
de9102f38a
commit
7601ba45de
|
@ -132,22 +132,16 @@ namespace Ooui
|
||||||
|
|
||||||
static Process StartBrowserProcess (string url)
|
static Process StartBrowserProcess (string url)
|
||||||
{
|
{
|
||||||
var cmd = url;
|
|
||||||
var args = "";
|
|
||||||
|
|
||||||
var osv = Environment.OSVersion;
|
|
||||||
if (osv.Platform == PlatformID.Unix) {
|
|
||||||
cmd = "open";
|
|
||||||
args = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
// var vs = Environment.GetEnvironmentVariables ();
|
// var vs = Environment.GetEnvironmentVariables ();
|
||||||
// foreach (System.Collections.DictionaryEntry kv in vs) {
|
// foreach (System.Collections.DictionaryEntry kv in vs) {
|
||||||
// System.Console.WriteLine($"K={kv.Key}, V={kv.Value}");
|
// System.Console.WriteLine($"K={kv.Key}, V={kv.Value}");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Console.WriteLine ($"Process.Start {cmd} {args}");
|
// Console.WriteLine ($"Process.Start {cmd} {args}");
|
||||||
return Process.Start (cmd, args);
|
|
||||||
|
return Environment.OSVersion.Platform == PlatformID.Unix
|
||||||
|
? Process.Start ("open", url)
|
||||||
|
: Process.Start (new ProcessStartInfo (url) { UseShellExecute = true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue