有没有办法在谷歌的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

创建快捷方式:


粘贴命令:

cmd/c start chrome--禁用web安全--用户数据dir=“c:\temp\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

有一个名为CORS Toggle的Chrome扩展。

单击此处访问并将其添加到Chrome。

添加后,将其切换到打开位置以允许跨域请求。

对于Windows:

(使用windows 8.1,chrome 44.0)

首先,关闭谷歌chrome。

然后,打开命令提示符并转到“chrome.exe”所在的文件夹。

( for me: 'chrome.exe' is here "C:\Program Files (x86)\Google\Chrome\Application".

所以我键入:cd C:\Program Files(x86)\Google\Chrome\Application)

现在键入:chrome.exe--禁用web安全

一个新的铬窗口将打开。