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


当前回答

Chrome的Allow Control Allow Origin插件不起作用。这是针对MacOS的

我将别名chrome='open-n-a/Applications/Google\chrome.app/Contents/MacOS/Google\Chrme--args-user data dir--disable web security'作为别名添加到我的.profile中。

其他命令将禁用我的其他扩展,这将在禁用cors的情况下启动正常的chrome

其他回答

我发现最好的方法是在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"

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

google-chrome  --disable-web-security

使用当前最新的chrome版本103.0.5060.134(官方版本)(64位)

windows:单击开始按钮,然后复制粘贴以下内容(根据您的喜好更改D:\temp)。:

chrome.exe  --disable-site-isolation-trials --disable-web-security --user-data-dir="D:\temp"

Linux:启动终端,然后运行以下命令(根据需要更改~/tmp目录)

google-chrome --disable-site-isolation-trials --disable-web-security --user-data-dir="~/tmp"

注意:此解决方案将在独立的沙盒中启动chrome,并且不会影响主chrome配置文件。

仅适用于MAC用户

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

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

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