通过移动设备上https:// localhost的服务人员

问题描述

我有一个基于http2的本地主机,可以通过以下地址访问它:

https://localhost:8443
页面中的

服务工作者,如果启动浏览器(铬),则可以在台式机开发计算机上正常工作:

chromium-browser \
  --ignore-certificate-errors \
  --unsafely-treat-insecure-origin-as-secure=https://localhost:8443

但是在移动chrome上不起作用,错误

DOMException: Failed to register a ServiceWorker for scope ('https://127.0.0.1:8443/') with script ('https://127.0.0.1:8443/sw.js'): An SSL certificate error occurred when fetching the script.

基音反复出现。

chrome://flags中,我启用了#enable-insecure-localhost,并且#unsafely-treat-…-as-secure设置为https://localhost,https://localhost:8443

还启用了端口转发功能,这样我就可以在设备浏览器中加载https://localhost:8443

要让服务人员工作,我在这里想念什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)