我可以通过 Intent
从 Forms 应用启动 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
以某种方式传递该设置?也许通过某种方式指定用户代理字符串?
最佳答案
无法使用 Intent 强制浏览器作为桌面站点启动。
为了让事情发生,您可以将查询参数添加到您的 URL,然后对网站进行编码以读取 URL 查询参数(如 www.google.com?mobile=false 中的 mobile=false),这样当服务器收到这样的请求,服务器生成一个桌面站点。
关于android - "Request Desktop Site"与 Xamarin Android 中的 Intent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59401192/