10月08, 2021

Chrome浏览器本地调试:阻止不安全、本地网络请求

Chrome浏览器本地调试:阻止不安全、本地网络请求

今天打开Chrome浏览器,本地开发联调突然报错。

Access to script at 'http://localhost:3000/xxx.js' from origin 'http://xxxx.com' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address spacelocal.

报错说我本地的文件因为跨域安全被阻止访问了。那我们本地调试就改一下Chrome的配置吧。

打开新的网页,浏览器输入:chrome://flags/#block-insecure-private-network-requests

禁用即可

截屏2021-10-08 下午4.33.16.png

本文链接:https://587v5.com/post/Chrome-liu-lan-qi-ben-de-diao-shi-:-zu-zhi-bu-an-quan-、-ben-de-wang-luo-qing-qiu.html

Comments