Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open custom scheme fails #157

Open
AlexHedley opened this issue Oct 3, 2020 · 1 comment
Open

Open custom scheme fails #157

AlexHedley opened this issue Oct 3, 2020 · 1 comment

Comments

@AlexHedley
Copy link
Contributor

Describe the bug
Trying to open mystreamtimer://countdown/?mins=15 fails.

var url = mystreamtimer://countdown/?topofhour`
await Manager.OpenUrlAsync(args.context, "https://www.bing.com");
  • OpenUrlAsync
    • Manager.OpenUrlAsync(args.context, "https://www.bing.com");

To Reproduce
Preferable
See @jamesmontemagno's stream
Stream Deck Extension for My Stream Timer

Expected behavior
Any url opens

Examples
mystreamtimer://countdown/?mins=15
mystreamtimer://countdown/?to=15:30
mystreamtimer://countdown/?topofhour

Added code from SO

private void OpenUrl(string url)
{
    try
    {
        Process.Start(url);
    }
    catch
    {
        // hack because of this: https://github.com/dotnet/corefx/issues/10361
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            url = url.Replace("&", "^&");
            Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
        {
            Process.Start("xdg-open", url);
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
        {
            Process.Start("open", url);
        }
        else
        {
            throw;
        }
    }
}

Error Details
N/A

Screenshots
N/A

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • Version [e.g. 22]

Additional context
N/A

@jamesmontemagno
Copy link
Contributor

I do know that the open website command of the built in website does work when i have my custom scheme set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants