首页 > 解决方案 > 当我使用来自 UWP 的 Launcher.LaunchUriAsync 转到 MS Edge 时,我可以删除搜索引擎请求吗?

问题描述

当 UWP 使用 Launcher.LaunchUriAsync 导航到 MS Edge 时,会自动添加搜索引擎请求。

我使用 Launcher.LaunchUriAsync 将地址传递给 Windows 默认浏览器。

string uriToLaunch = @"https://proxy.intu-soft.com/?server=google!%*qs=test";
uri = new Uri(uriToLaunch);
await Windows.System.Launcher.LaunchUriAsync(uri);

它移至“ https://www.google.com/search?q=https%3A%2F%2Fproxy.intu-soft.com%2F%3Fserver%3Dgoogle!%25 *qs%3Dtest&ie=&oe=" 而不是“ https://proxy.intu-soft.com/?server=google!% *qs=test” 仅在 Edge 上。

标签: c#uwpmicrosoft-edge

解决方案


我注意到您的 Url 最终指向的地址是

https://patents.google.com/?q=test&oq=test

可以直接使用这个Url启动。

URL跳转变成了搜索引擎搜索,也就是说Edge浏览器无法将你的链接识别为正常的http(s)链接,这可能是由于你的链接中存在异常字符造成的。

虽然这个链接在地址栏输入时可以被识别,但是会经过一个跳转。通过 启动时Launcher,浏览器将首先确定链接。如果不符合要求,浏览器不会将其视为链接。

这就是不同浏览器的不同处理方式。这不是问题Launcher

此致。


推荐阅读