21

Today (Mar, 15, 2016) chrome stopped working with the --disable-web-security flag. I have tried the following options described in various posts: 1) Kill all instances of Chrome.exe in the windows task manager. 2) add the --use-data-dir flag, there is a current post regarding this, but the answers there do not work anymore

Here is my script I am using:

start chrome.exe --disable-web-security --allow-running-insecure-content --use-data-dir=c:/temp/chrome_dev

Chrome opens under this script with the disable security warning but localhost cross domain calls still fail:

enter image description here

Community
  • 1
  • 1
John Maloney
  • 1,106
  • 3
  • 15
  • 26

7 Answers7

29

I have solutions that are using --disable-web-security.

Finally I found solution. Now chrome just will accept it if you set --user-data-dir together. You will have different instances when you use it. Try it:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="D:\chrome"
dur
  • 15,689
  • 25
  • 79
  • 125
  • I tried this, copied the batch script directly, no changes and it worked, thanks! – John Maloney Mar 15 '16 at 23:27
  • 2
    Instead of using an arbitrary directory, you can omit the value of user-data-dir. The following works for me on Windows 10 with Chrome 49: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir – raider33 Apr 01 '16 at 14:18
  • doesn't make much sense but seems to have worked for me. – victor May 21 '16 at 11:39
  • Works on version 56. Thanks – Suresh Mar 22 '17 at 23:48
  • Works on version 59 (with an empty --user-data-dir), even though the alert is still displayed. Thanks – BenC Jul 04 '17 at 14:09
19

For linux

google-chrome  --user-data-dir=”/var/tmp/Chrome” --disable-web-security

I suggest a temp directory

Adam111p
  • 3,469
  • 1
  • 23
  • 18
  • Kept getting `browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process. Created new window in existing browser session.` when I ran the command **without** the `--user-data-dir` flag. Your answer fixed the issue for me. Thanks! – Chris Mar 27 '18 at 13:54
  • @Adam11p Based on your answer, I have created an alias. `alias google_chrome_security_disabled='google-chrome --user-data-dir="/home/rudy/.config/google-chrome_security_disabled" --disable-web-security'` – Rudy Vissers Apr 22 '22 at 09:13
5

Just for OS X user, this worked for me (on El Capitan): /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --user-data-dir="<some-dir>"

Also works on Yosemite 10.10.5. Please note that --user-data-dir may no longer be left empty. You have to specify some dir.

Per Quested Aronsson
  • 11,380
  • 8
  • 54
  • 76
Silvain
  • 399
  • 4
  • 20
  • 5
    This doesn't work for me, this does ```open -a /Applications/Google\ Chrome.app --args --disable-web-security --user-data-dir=""``` – Kevin C Jones Mar 23 '16 at 10:23
  • Recently, this hasn't been working for me without specifying an existing `user-data-dir` directory, which needs to be cleared on every session. That also resets all history, user preferences, logins, ... every single time. This being extremely irritating, I have now started using this Chrome extension instead: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en – Silvain Oct 16 '18 at 07:11
5

This doesn't work anymore, since Chrome 80. You have to specify a non-default --user-data-dir to make it work now.

Original answer:

You can use your existing data dir, if you don't want to create a new one.

So on Linux the command to start unsafe Chrome will be something like this:

google-chrome --user-data-dir=/home/<your username>/.config/google-chrome --disable-web-security

But don't use this Chrome instance for anything except development or debugging, since it's open for a vast amount of web attacks.

Neurotransmitter
  • 6,289
  • 2
  • 51
  • 38
2

This works with chrome 61 too for me -

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security
Tushar Walzade
  • 3,737
  • 4
  • 33
  • 56
0

Do not disable web security. You're opening your accounts to attacks and your local files to being stolen.

Instead use a simple web server. It will take you all of 2 minutes to install and use. Here's one with a gui, and here's several more that run from the command-line

E_net4
  • 27,810
  • 13
  • 101
  • 139
gman
  • 100,619
  • 31
  • 269
  • 393
0

Update: I have found a permanent solution for this disable web security issue.

step 1: create 1 chrome app shortcut on desktop and rename it anything like "disabled-security.exe"

step 2: right click on icon and go to properties => change target input box to something like following eg. and save it.

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-site-isolation-trials --user-data-dir=c:\chromeSession

step 3: launch this app, it will work fine as expected

Note: everytime you need to clear folder "c:\chromeSession" before opening this app

Sandip Jadhav
  • 137
  • 1
  • 7