有没有办法在谷歌的Chrome浏览器上禁用同源策略?


当前回答

若您在Linux上使用Google Chrome,则以下命令有效。

google-chrome  --disable-web-security

其他回答

在Linux-Ubuntu上,要同时运行正常会话和不安全会话,请运行以下命令:

google-chrome  --user-data-dir=/tmp --disable-web-security

若您在Linux上使用Google Chrome,则以下命令有效。

google-chrome  --disable-web-security

在Mac终端上尝试此命令-

open -n -a "Google Chrome" --args --user-data-dir=/tmp/temp_chrome_user_data_dir http://localhost:8100/ --disable-web-security 

它打开了另一个具有禁用安全性的chrome实例,并且不再存在CORS问题。此外,您不再需要关闭其他chrome实例。将localhost URL更改为您的URL。

对于mac用户:

open -a "Google Chrome" --args --disable-web-security --user-data-dir

在Chrome 48之前,您可以使用:

open -a "Google Chrome" --args --disable-web-security

在Ubuntu中使用以下命令启动chrome(禁用同源策略并在分离模式下打开chrome):

nohup google-chrome --disable-web-security --user-data-dir='/tmp' &