如何设置Chrome浏览器跨域
Access to XMLHttpRequest at 'xxxxxx' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
浏览器阻止跨域。
注:跨域存在安全风险,仅用于调试或者测试场景。
-
复制浏览器快捷键,
-
新建空白文件夹C:\chromeDataTest
-
右键属性, 修改 目标,在后面添加–disable-web-security --user-data-dir=C:\chromeDataTest
注意–前面需要空格
--disable-web-security --user-data-dir=C:\chromeDataTest
- 使用该快捷方式打开浏览器,出现如图提示,就开启了浏览器跨越。