Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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...

share|improve this question

5 Answers 5

up vote 16 down vote accepted

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.

share|improve this answer
1  
You can tell Chrome to start a new session by passing it a new user data directory. Yup; in fact, it does this with most switches; an “instance” is Chrome run with a unique set of arguments (in any order). It may not behave exactly the same now, but user-data-dir at a minimum will still trigger a new instance. Window drag & drop won't work between these two windows. Nope; as far as Chrome is concerned, they are from two different browsers/apps. Also be wary of handlers: running an .htm file or bookmark will open in an instance with the args specified in the type registration. –  Synetech May 13 '13 at 3:35
    
Is there a way to do this in Mac OS X? –  aug Jul 22 at 17:39
    
@aug: I can't test this, but try (from the terminal): open -a /Applications/Chrome.app --user-data-dir="/tmp/chrome_dev_session" --disable-web-security. I'm assuming here that OSX has a "/tmp/" directory, you can change the path if it doesn't. –  Hubro Jul 22 at 17:48
    
Hmmm didn't work. I played around with the file path too @_@ tried things like $TMPDIR and such. Might play with it more later when I get the chance. –  aug Jul 22 at 17:58
    
@aug: Tell me if you figure it out, I'll add it to the answer :) –  Hubro Jul 22 at 17:59

You can open chrome using following code in "RUN"

chrome.exe --allow-file-access-from-files --disable-web-security
share|improve this answer

You can use some fork of Chrome as a second browser, like Iron or Dragon. Maybe a portable instance of Chrome would work too.

share|improve this answer

Responding to @aug and @hubro's comments, you can use the open command's -n flag to open a new instance of an app via Mac OS X's Terminal:

open -n -a /Applications/Chrome.app

You can add any flags that you want to use (like --disable-web-security) onto the end of that command.

share|improve this answer
    
This doesnt seem to create a new instance. Because when I try it in the old instance (with security not disabled) I can do cors –  tobbe Aug 20 at 11:40
    
Huh, you're right! The man page of the open command does indicate that the -n flag is for opening a new instance of an application, but it seems like Chrome & Chromium have some kind of logic preventing multiple instances of the application from being opened. The command works as is for Safari, for example. –  arielkirkwood Sep 2 at 19:45

For mac:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir="/tmp/chrome_dev_session" --disable-web-security

Replace with your particular path to chrome if necessary.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.