Disable-web-security in Chrome 48+

前端 未结 13 2469
遇见更好的自我
遇见更好的自我 2020-11-27 10:33

I have a problem with the --disable-web-security flag. It is not working in Chrome 48 and Chrome 49 beta on Windows.

I\'ve tried killing all of the inst

13条回答
  •  -上瘾入骨i
    2020-11-27 10:50

    On OS X, to open a new Chrome window - without having to close the already open windows first - pass in the additional -n flag. Make sure to specify empty string for data-dir (necessary for newer versions of Chrome, like v50 something+).

    open -na /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir=""
    

    I found that using Chrome 60+ on Mac OS X Sierra, the above command no longer worked, but a slight modification does:

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

    The data directory path is important. Even if you're standing in your home directory when issuing the command, you can't simply refer to a local directory. It needs to be an absolute path.

提交回复
热议问题