关于Chrome跨域The request client is not a secure context and the resource is in more-private address space loca相关提示的解决

最近想使用serve 配置一个本地的 chrome 脚本注入功能, 没想到浏览器提示:

Access to script at ‘http://localhost:85/index.js‘ from origin ‘http://www.xxx.com‘ has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local.

貌似是chrome有设置, 在地址栏中输入:
chrome://flags/#block-insecure-private-network-requests

然后选Disabled ,relaunch 后就能恢复正常了, 根据翻译:

block-insecure-private-network-requests
防止非安全上下文向更私密的IP地址发出子资源请求。如果1)IP1是本地主机,而IP2不是,或者2)IP1是私有的,而IP2是公共的,则IP地址IP1比IP2更私有。这是全面实施CORS-RFC1918的第一步:https://wicg.github.io/cors-rfc1918–Mac、Windows、Linux、Chrome OS、Android、Fuchsia
阻止不安全的专用网络请求

应该是处于安全考虑, 禁止向私有地址请求和发生数据

文章不错, 赏你二两银子

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续努力!