Class BrowserLauncher
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Opens a link in the user's browser.
Everywhere else in the app the URL is a constant we wrote. In the store it comes from
Modrinth — an author fills in "source", "wiki" or "discord", and the long description is full
of links — so it is untrusted input. UseShellExecute hands whatever it is given to the
shell, which would happily run a local executable or a registered custom scheme, so only
absolute http/https URLs are ever passed through.
public static class BrowserLauncher
- Inheritance
-
BrowserLauncher
- Inherited Members
Methods
IsWebUrl(string?)
True when url is an absolute http(s) URL and is safe to open.
public static bool IsWebUrl(string? url)
Parameters
urlstring
Returns
Open(string?)
Opens the link if it is a web URL. Anything else is ignored, silently and on purpose.
public static void Open(string? url)
Parameters
urlstring