禁用 Chrome 网络安全后 CORS 仍然强制执行?
CORS still enforced after disabling Chrome web security?
我正在尝试从一个网站获取数据并使用它向另一个网站写入内容(使用 JQuery/Javascript)。可以理解,同源规则不会让这种情况发生,但我认为在我的浏览器上禁用 web security/CORS 应该可以解决这个问题。出于某种原因,我无法在 Chrome 中禁用该策略,我也不知道为什么。
我尝试使用 --disable-web-security --user-data-dir=
启动 Chrome
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\Users\<username>\Desktop\chromeTemp"
我希望能够打开一个新选项卡,在控制台中访问 'document',然后找到一个 link 我想 'click',但我却得到了 [=13] =]
VM186:1 Uncaught DOMException: Blocked a frame with origin <url> from accessing a cross-origin frame.
我以为这不会再被阻止了?
看起来可能存在一个未解决的错误,可能会尝试较旧的 chrome 版本。
https://bugs.chromium.org/p/chromium/issues/detail?id=840124
查看关于解决方法的最后评论:
"The workaround is to download an old version of Chrome as a portable app : https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/ (version 66.0.3359.181 still works). It's the one I use when I'm developing..."
我正在尝试从一个网站获取数据并使用它向另一个网站写入内容(使用 JQuery/Javascript)。可以理解,同源规则不会让这种情况发生,但我认为在我的浏览器上禁用 web security/CORS 应该可以解决这个问题。出于某种原因,我无法在 Chrome 中禁用该策略,我也不知道为什么。
我尝试使用 --disable-web-security --user-data-dir=
启动 Chrome"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\Users\<username>\Desktop\chromeTemp"
我希望能够打开一个新选项卡,在控制台中访问 'document',然后找到一个 link 我想 'click',但我却得到了 [=13] =]
VM186:1 Uncaught DOMException: Blocked a frame with origin <url> from accessing a cross-origin frame.
我以为这不会再被阻止了?
看起来可能存在一个未解决的错误,可能会尝试较旧的 chrome 版本。
https://bugs.chromium.org/p/chromium/issues/detail?id=840124
查看关于解决方法的最后评论:
"The workaround is to download an old version of Chrome as a portable app : https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/ (version 66.0.3359.181 still works). It's the one I use when I'm developing..."