有没有办法在谷歌的Chrome浏览器上禁用同源策略?
当前回答
您可以简单地使用这个chrome扩展名Allow Control Allow Origin
只需单击扩展图标即可根据需要打开或关闭跨资源共享
其他回答
对于使用**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版本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配置文件。
在Windows PC上,使用较旧版本的Chrome,该命令将适用于所有人。我把我的Chrome降到了26版,而且效果不错。
在Windows 10上,以下功能将起作用。
<<path>>\chrome.exe --allow-file-access-from-files --allow-file-access --allow-cross-origin-auth-prompt
在Linux-Ubuntu上,要同时运行正常会话和不安全会话,请运行以下命令:
google-chrome --user-data-dir=/tmp --disable-web-security