Windows – Is it possible to run Chrome with and without web security at the same time

google-chromewindows

I recently found out that I can disable Chrome "web security" using a command line argument, making JavaScript development easier. The issue is that I can't seem to run more than one "instance" of Chrome at a time. If I chrome.exe --disable-web-security while Chrome is alread running, it just opens a new window within the running instance and ignores my command line arguments. I can close Chrome completely and relaunch it with the above command line argument, but then all my windows will be running without web security, which is a bad thing for general browser usage.

So to summarize the question: Is it possible to start an instance of Chrome with the --disable-web-security flag while a normal Chrome instance is running?


Note: I suspect the answer may lay within the Chrome command line switches, but there are just… so many…

Best Answer

I found a similar question on Ask Ubuntu. Apparently you can tell Chrome to start a new session by passing it a new user data directory. This means I can now run this command:

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

And a new Chrome window opens with web security disabled. Yay!


Note: This means that window drag & drop won't work between these two windows.

Related Question