mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Core - Added utility for opening URLs in the default browser
This commit is contained in:
1 parent
016d39d034
commit
8be1945145
7 files changed
+28
-22
No files matched your search
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Stylet;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Home
|
||||
{
|
||||
@@ -13,12 +11,7 @@ namespace Artemis.UI.Screens.Home
|
||||
|
||||
public void OpenUrl(string url)
|
||||
{
|
||||
// Don't open anything but valid URIs
|
||||
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
|
||||
{
|
||||
url = url.Replace("&", "^&");
|
||||
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") {CreateNoWindow = true});
|
||||
}
|
||||
Core.Utilities.OpenUrl(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user