Launch External Url in Browser from Windows Store App

The java script code for achieving this:

// Create a Uri object from a URI string 
var uri = new Windows.Foundation.Uri("http://test.com");
var options = new Windows.System.LauncherOptions();
// Launch the URI with a warning prompt
options.treatAsUntrusted = true;
// Launch the URI
Windows.System.Launcher.launchUriAsync(uri, options).then(
function (success) {
       if (success) {
           // URI launched
       } else {
           // URI launch failed
       }
});

 


Leave A Comment

Your email address will not be published.