&引用;“请求桌面站点”;有意使用Xamarin Android

&引用;“请求桌面站点”;有意使用Xamarin Android,android,xamarin,firefox,android-intent,xamarin.android,Android,Xamarin,Firefox,Android Intent,Xamarin.android,我可以通过Intent从表单应用程序启动Firefox Mobile: private const string FirefoxPackage = "org.mozilla.firefox"; private void App_FirefoxUriRequested(object sender, string e) { var intent = new Intent(); intent.SetPackage(FirefoxPackage); intent.SetActi

我可以通过
Intent
从表单应用程序启动Firefox Mobile:

private const string FirefoxPackage = "org.mozilla.firefox";

private void App_FirefoxUriRequested(object sender, string e)
{
    var intent = new Intent();
    intent.SetPackage(FirefoxPackage);
    intent.SetAction(Intent.ActionView);
    intent.SetData(Android.Net.Uri.Parse(e));
    StartActivity(intent);
}
如果安装,Firefox将打开一个新选项卡,其中包含
e
参数传递的URL。这很有效


在Firefox Mobile中,省略号(…)下拉列表下有一个“请求桌面站点”的复选框。有没有办法通过URL或
Intent
传递该设置?也许通过某种方式指定用户代理字符串?

无法使用意图强制浏览器作为桌面站点启动


为了让事情发生,您可以向URL添加查询参数,然后对网站进行编码以读取URL查询参数(如www.google.com?mobile=false中的mobile=false),这样当服务器收到这样的请求时,服务器生成桌面站点。

无法使用意图强制浏览器作为桌面站点启动


为了使某些事情发生,您可以向URL添加查询参数,然后对网站进行编码以读取URL查询参数(如www.google.com?mobile=false中的mobile=false),这样当服务器收到这样的请求时,服务器就会生成一个桌面网站。

谢谢@Saamer。那太糟糕了。我希望在任何网站上使用类似的东西,而不一定是我们控制的网站。如果你在应用程序中加载web URL,那么你可以调用JS代码。因此,也许有一些JS代码可以称之为youThanks@Saamer的桌面站点请求。那太糟糕了。我希望在任何网站上使用类似的东西,而不一定是我们控制的网站。如果你在应用程序中加载web URL,那么你可以调用JS代码。因此,也许有一些JS代码可以调用,为您请求桌面站点