Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

52讲-EIP712,其中的html文件运行报错 #602

Closed
cxp-13 opened this issue Nov 28, 2023 · 2 comments · Fixed by #825
Closed

52讲-EIP712,其中的html文件运行报错 #602

cxp-13 opened this issue Nov 28, 2023 · 2 comments · Fixed by #825
Labels
enhancement New feature or request

Comments

@cxp-13
Copy link
Contributor

cxp-13 commented Nov 28, 2023

image
已经讲合约地址改为部署的地址

@gsangeryee
Copy link

这是因为 MetaMask 的内容安全策略(Content Security Policy)的要求。MetaMask 只会在通过 HTTP/HTTPS 协议访问的页面中注入 window.ethereum 对象,而不会在直接打开的本地文件(file:// 协议)中注入。

所以需要在本地服务器中加载 html 文件才可以运行。我使用的是 VS code 的 Live Server 插件。

@XdpCs XdpCs closed this as completed Nov 1, 2024
@XdpCs XdpCs reopened this Nov 1, 2024
@XdpCs XdpCs added the enhancement New feature or request label Nov 1, 2024
@XdpCs
Copy link
Collaborator

XdpCs commented Nov 1, 2024

增加这个点的解释,可以让大家更好的使用教程

smallfu6 added a commit to smallfu6/WTF-Solidity that referenced this issue Nov 2, 2024
@smallfu6 smallfu6 mentioned this issue Nov 2, 2024
4 tasks
@XdpCs XdpCs assigned XdpCs and unassigned XdpCs Nov 4, 2024
@XdpCs XdpCs closed this as completed in #825 Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants