如何处理Chrome 中CORS问题

Windows

Just do follow steps:

  • Right click on the desktop, add a new shortcut
  • Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security -- -disable-gpu --user-data-dir=~/chromeTemp
  • Click OK.

NOTE: On Windows 10 command will be: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp

OSX

open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security

Linux

google-chrome --disable-web-security

If you need access to local files for dev purposes like AJAX or JSON, you can use -–allow-file-access-from-files flag.

Remark

Since Chrome 22+ you will get an error message that says:

You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 12,886评论 0 6
  • We have always solemnly promised to protect the privacy o...
    夜耶烨阅读 6,600评论 0 0
  • Here is our training plan. Our agenda for this training m...
    FlyingPeter阅读 3,161评论 0 0
  • 一天,我的爸爸和妈妈都出差了,所以,我就到王耀康家寄宿了。 我到王耀康家的时候,发现他生病了发高烧,一直烧个不停,...
    王若轲阅读 1,423评论 0 0
  • 七律/大基督虎刺梅 作者:心博、图片:网络 一年四季见花开,多彩多姿虎刺梅。 粉绿白黄犹有复,修粗挺直更兼魁。 利...
    心博1阅读 4,476评论 0 0

友情链接更多精彩内容