Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为什么我注册的协议处理程序无法触发chrome应用程序';s url_直接处理程序?_Javascript_Google Chrome_Google Chrome App - Fatal编程技术网

Javascript 为什么我注册的协议处理程序无法触发chrome应用程序';s url_直接处理程序?

Javascript 为什么我注册的协议处理程序无法触发chrome应用程序';s url_直接处理程序?,javascript,google-chrome,google-chrome-app,Javascript,Google Chrome,Google Chrome App,为了启动我的chrome应用程序,我在manifest.json中设置了一个url_处理程序,如下所示: "url_handlers": { "view": { "matches": [ "http://test.view.com/start.html*" ], "title": "view" } } var url = "http://test.songli.com/start.html?data=%s"; wind

为了启动我的chrome应用程序,我在manifest.json中设置了一个url_处理程序,如下所示:

  "url_handlers": {
    "view": {
      "matches": [
        "http://test.view.com/start.html*"
      ],
      "title": "view"
    }
  }
var url = "http://test.songli.com/start.html?data=%s";
window.navigator.registerProtocolHandler("web+view", url, "Test");
因此,现在当我打开链接“*”时,chrome应用程序可以成功启动。 然后,我注册协议处理程序以创建自己的url模式,如下所示:

  "url_handlers": {
    "view": {
      "matches": [
        "http://test.view.com/start.html*"
      ],
      "title": "view"
    }
  }
var url = "http://test.songli.com/start.html?data=%s";
window.navigator.registerProtocolHandler("web+view", url, "Test");
问题来了。当我打开“web+视图:数据”链接时,浏览器可以打开“”。但是,我的chrome应用程序这次无法启动。只有刷新页面后,应用程序才能打开。
事实上,我想要的是通过打开“web+视图:数据”链接直接打开我的chrome应用程序。这样做有什么不对吗?

没什么不对,只是没有计划这样做。协议处理程序只在网站上工作(目前),期待着修复这个问题。。。