[UWP]从设备浏览器(Safari,Chrome,Edge)上的本机应用程序打开Web链接,而不是在Container中 [英] [UWP]Open Web Links From Native App on Device Browser(Safari,Chrome,Edge) not in Container

查看:111
本文介绍了[UWP]从设备浏览器(Safari,Chrome,Edge)上的本机应用程序打开Web链接,而不是在Container中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都建议如何在设备浏览器(Safari,Chrome,Edge)上打开不在容器中的本地应用程序的Web链接



在容器中(在应用程序浏览器中)使用默认的Cordova插件正常工作。但我的要求是在Safari,Chrome等设备的外部浏览器中打开它。


我们正在使用Microsoft Surface。是否有任何脚本帮助我们做到这一点。我试过window.open("https://www.google.com",'_ system'),window.href()等...。但是nothinfg正在工作

Anyone suggest how to Open Web Links From Native App on Device Browser(Safari,Chrome,Edge) not in Container

In Container( In App Browser) was working fine with default Cordova plugin.But my requirement is to open that in external browser of device like Safari ,Chrome

We are using Microsoft Surface .Is there any scrip that help us to do that.I tried window.open("https://www.google.com",'_system'),window.href() etc... .But nothinfg was working

推荐答案

您的应用的类型是什么?它是一个UWP应用程序吗?

What's the type your app? Is it a UWP app?

所以你想从你的应用程序启动设备的默认浏览器吗?在UWP应用中,您可以使用  Launcher
Class

So you want to launch the default browser of the device from your app right? In UWP apps, you could do that using Launcher Class.

像这样:

private async void launchURI_Click(object sender, RoutedEventArgs e)
{
   // The URI to launch
   var uriBing = new Uri(@"http://www.bing.com");

   // Launch the URI
   var success = await Windows.System.Launcher.LaunchUriAsync(uriBing);

   if (success)
   {
      // URI launched
   }
   else
   {
      // URI launch failed
   }
}

有关详细信息,请参阅:启动URI的默认应用

For more information, please refer:Launch the default app for a URI.

祝你好运,

Roy


这篇关于[UWP]从设备浏览器(Safari,Chrome,Edge)上的本机应用程序打开Web链接,而不是在Container中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆