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


当前回答

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

google-chrome  --disable-web-security

其他回答

对于使用**Chrome版本60.0.3112.78(解决方案测试和工作的当天)的windows用户,至少到今天为止是2022年11月24日(版本106.05.249.119(官方版本)(64位))。您不需要关闭任何chrome实例。

在桌面上创建快捷方式右键单击快捷方式,然后单击“财产”编辑Target属性将其设置为“C:\Program Files(x86)\Google\Chrome\Application\Chrome.exe”--禁用web安全--用户数据dir=“C:\ChromeDevSession”启动chrome并忽略消息:禁用网络安全不受支持!

注意不要使用这个特定的浏览器实例进行浏览,因为你可能会被黑客入侵!

您可以简单地使用这个chrome扩展名Allow Control Allow Origin

只需单击扩展图标即可根据需要打开或关闭跨资源共享

在Windows 10上,以下功能将起作用。

<<path>>\chrome.exe --allow-file-access-from-files --allow-file-access --allow-cross-origin-auth-prompt

我发现最好的方法是在windows桌面上复制Chrome或Chrome Canary快捷方式。将此快捷方式重命名为“NO CORS”,然后编辑该快捷方式的财产。

在目标路径的末尾添加--disable-web security--user data dir=“D:/Chrome”。

你的目标应该是这样的:

更新:添加了新标志。

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="D:/Chrome"

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

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