transcrypt 应该从本地文件系统 运行 吗?

Is transcrypt supposed to run from the local filesystem?

我已经安装了 Transcrypt,编译了 Hello Solar System 演示,并且 运行 使用 python 网络服务器按照说明进行了编译。

但是,我也能够 运行 直接从 Chrome Windows 的 hello.html 文件 Windows 10 ... 一次.随后它拒绝 运行 - 按钮出现但单击它们不会更新文本。

--------编辑--------

谢谢 - CORS 是问题所在 - 浏览器必须连接到 Web 服务器,而不是本地文件系统上的文件。

您可能 运行 加入了名为 CORS 的 Chrome 安全策略。使用 python -m http.server 从 html 文件所在的目录启动网络服务器,然后浏览至 localhost:8000。在您的浏览器 window 中,单击 html 文件,一切正常。