【发布时间】:2020-03-08 17:02:12
【问题描述】:
我正在使用 Windows 和适用于 Linux 的 Windows 子系统在我的机器上调试网站。
我在我的网站中使用cross-storage。我可以在 Chrome 下启动网站https://localhost:3000/sign,而在 IE 中会引发错误CrossStorageClient could not connect,从而阻止页面。
CrossStorageClient could not connect 在 IE 中
在客户端,似乎是new CrossStorageClient(...) 引发了错误。
const storage = new CrossStorageClient(`https://localhost:3000/htmls/hub.html`, {});
export async function getSignToken() {
await storage.onConnect();
如果我在 IE 的标签页中打开https://localhost:3000/htmls/hub.html,它会显示security certificate 的问题,我可以点击Go on to the webpage (not recommended) 继续。 (无论如何,客户端的CrossStorageClient could not connect 错误仍然会引发)。
这里是服务器端的hub.html:
<!doctype html>
<head>
<title>Production Cross Storage Hub</title>
</head>
<body>
<script type="text/javascript" src="/javascripts/hub.js"></script>
<script>
CrossStorageHub.init([
{origin: /:\/\/localhost(:[0-9]*)?$/, allow: ['get', 'set', 'del']},
{origin: /\.10studio.tech$/, allow: ['get', 'set', 'del']},
{origin: /:\/\/(www\.)?10studio.tech$/, allow: ['get', 'set', 'del']}
]);
</script>
</body>
</html>
那么,有谁知道如何解决这个CrossStorageClient could not connect 错误?
除了CrossStorageClient还有其他选择吗?
【问题讨论】:
-
您是否有 IE 的 async/await pollyfil 或任何其他工具,例如 Babel..? IE 不支持此功能:caniuse.com/#search=async
-
我忘了说这个链接很有用:stackoverflow.com/questions/47684102/…
-
请勿发布代码、数据、错误消息等的图片 - 将文本复制或输入到问题中。 How to Ask
标签: localhost ssl-certificate local-storage virtual-machine cross-domain