Development, testing, staging environments are controlled via different proxy servers in my setup. I want to script creation of multiple Chrome profiles (sometimes called "user" or "person") and connect to a different proxy server for each of them. Finally I want to share this script with colleagues so that they have access to the exactly same setup.
The latter can be done via scripted installation of extensions such as Falcon Proxy or Proxy Helper to the Chrome profile. I would like to know how to script creation of the different profiles.
A profile is a folder inside ~/.config/google-chrome
(Linux, ~/Library/Application Support/Google/Chrome
(Mac OS X) and %USERPROFILE%\AppData\Local\Google\Chrome\User Data
(Windows). But how to create and initialize one? Where do I register the new profile?
Creating a user
The following example applies to Windows, but the basic procedure should be the same.
First, change to the UserData folder in your Chrome installation:
This method will copy the current user as a template for the new user. If the new user should be blank, you need to delete (
CTRL + SHIFT + DEL
the current browser data).Now create a new user:
Change your directory to the chrome installation:
Factory-Reset all user parameters:
where
--user-data-dir
is the path (full or relative) to the previously created NewUser directory.Running as NewUser
To run chrome again using this profile, simply run chrome without the
-first-run
flag.