【Google Chrome】 Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource问题解决

  疑问 ??Google Chrome浏览器打开本地html文件报错如下

原因  浏览器为了安全性考虑,默认对跨域访问禁止

    解决方法

 方案一、 Google Chrome应用程序目标位置中添加  chrome.exe --allow-file-access-from-files  

! 注意中间空格(chrome.exe  --allow-file-access-from-files)

注意!!!   必须重新启动电脑,否则无效......若方案一还无效,继续执行方案二

方案二、 使用cmd命令 传入浏览器启动参数 --allow-file-access-from-files

第三步 用启动浏览器打开html文件即可. 若还出现上述问题,重启电脑,继续方案二

原文地址:https://www.cnblogs.com/h2zZhou/p/7125318.html