当我尝试在本地运行Polymer Shop时,使用端口5000在本地主机上使用SimpleHTTP2Server进行捆绑和非捆绑构建时,对service-worker.js的请求失败:< / p>
An SSL certificate error occurred when fetching the script.
https://localhost:5000/service-worker.js Failed to load resource: net::ERR_INSECURE_RESPONSE
(index):1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.
有一种简单的方法可以让它发挥作用吗?我尝试了许多启动标志,例如:
chrome.exe --ignore-certificate-errors --incognito
--unsafely-treat-insecure-origin-as-secure --allow-insecure-localhost
但这没有帮助,我仍然得到:
(index):1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: An SSL certificate error occurred when fetching the script.
答案 0 :(得分:2)
根据alesc的建议,我找到了说明here:
这些是Windows 10上Chrome 55的说明。似乎这些步骤可能会经常更改。