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