How to launch the specific url in specific browser?

Xie Steven 831 Reputation points
2022-10-21T02:17:13.19+00:00

Hello Guys,

I have a requirement that UWP app will launch the specific url in the specific browser(e.g, IE).

My existing winform application uses the IWebBrowser2 APIs to launch the IE browser with some other optional parameters(e.g, make the browser start in FullScreen mode and postData for that url).

I want to make the UWP app get the same target.

So, I want to know whether this IWebBrowser2 APIs is available in UWP app?

If it's not supported, are there any other ways to get the same effect?

Best Regards,
Steven

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 32,996 Reputation points Microsoft Vendor
    2022-10-21T06:30:47.653+00:00

    Hello,

    Welcome to Microsoft Q&A!

    How to launch the specific url in specific browser?

    First of all, you could launch a specific URL in the default browser from the UWP app by calling Launcher.LaunchUriAsync Method. Like this:

      // The URI to launch  
       var uri = new Uri(@"http://www.microsoft.com");  
      
       // Launch the URI  
       var success = await Windows.System.Launcher.LaunchUriAsync(uri);  
    

    But there is one thing that needs to be noticed. Only the default browser of the system will be launched. If the default browser of the system is Microsoft Edge, and this method will only launch
    Microsoft Edge for the URL. There is no API for UWP that could set which browser will be launched.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.