【问题标题】:Detecting custom url protocol handler using javascript in windows 10 Edge Browser在 Windows 10 Edge 浏览器中使用 javascript 检测自定义 url 协议处理程序
【发布时间】:2015-07-03 10:40:08
【问题描述】:
在我们的 Web 应用程序中,我们需要使用带有 Windows 10 EDGE 浏览器的 javascript 在 Windows 10 机器上确定 自定义 URL 协议处理程序是否已注册。。 p>
如果 自定义 URL 协议处理程序 未在 windows 10 机器中注册,我们将要求用户下载我们的桌面独立应用程序。
如果已注册,我们将使用已注册的自定义 URL 协议处理程序启动我们的桌面独立应用程序。
由于 EDGE 是新浏览器,互联网上其他用户提供的解决方案无法正常工作。
我提到的在 EDGE 浏览器中不适合我的链接:
https://gist.github.com/keyvanfatehi/f2f521c654bab106fdf9
请帮帮我,
谢谢
【问题讨论】:
标签:
javascript
internet-explorer
browser
microsoft-edge
url-protocol
【解决方案1】:
也许这种解决方法有帮助:
每当您使用 MS Edge 导航到未知协议时,Windows 都会询问用户有关处理该协议的应用程序。您可以导航到您的协议并显示一条消息,其中包含有关如果该工具未打开该做什么的一些信息。像这样的东西(对不起德国的截图):
<div id="toolBox">
<p id="toolBoxText"></p>
<input type="button" id="toolButton" onclick="openTool()" value="Start tool" />
</div>
<script type="text/javascript">
function openTool(){
window.location = 'myprotocol://command/';
document.getElementById("toolButton").value = "Try again";
document.getElementById("toolBoxText").innerHTML = "Thank you for using our tool. If the tool did not open successfully, please first download and install the tool <a href='download/'>here</a> and then try again."
}
</script>