Can you run multiple Chrome instances with different proxies? - google-chrome

I'm trying to run multiple instances of of Chrome with different proxies. Searching the web I've found that chrome supposedly supports 'chrome.exe --proxy-server="proxy:port" ' from the command line. But I've tried that and it doesn't work.
Is there any way to run multiple instances of Chrome with different proxies?
Thanks!

The answer from gengkev is correct. For all users combing from search engines who need a quick "copy and paste" solution, use this link target (windows):
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="http://proxy01.your.proxy:3128" --user-data-dir="%LOCALAPPDATA%\Google\Chrome-proxy01\User Data"
Chrome will create this new folder "Chrome-proxy01" on its own. With this you can have multiple chrome shortcuts using different proxy servers.

If you're running more than one instance of chrome with different flags, I think you need to specify different paths to --user-data-dir.

As mentioned in the previous answer, the way to do that is to:
Pass a --proxy-server parameter
Pass a different user data directory path for every launch with a different proxy server
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="http://proxy01.your.proxy:3128" --user-data-dir="%LOCALAPPDATA%\Google\Chrome-proxy01\User Data"
Where %LOCALAPPDATA%\Google\Chrome-proxy01\User Data folder needs to be unique for any new instance that uses a different proxy. So use %LOCALAPPDATA%\Google\Chrome-proxy02\User Data for the second launch, %LOCALAPPDATA%\Google\Chrome-proxy03\User Data for the third launch etc.
I would also highly advise to use the --no-first-run flag to get rid of the annoying popup that asks you whether you want to set chrome as your default browser every time you launch it with a new data directory
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="http://proxy01.your.proxy:3128" --user-data-dir="%LOCALAPPDATA%\Google\Chrome-proxy01\User Data" --no-first-run

Yes, you can run it. To do so:
Install the extension SwitchyOmega in the profiles that you want to use proxy.
Create a profile with your desired name and enter the details of the proxy that you wish to use.
Save the changes using apply changes button.
Switch to your proxy using the extension button present on the top right corner of the chrome.
In addition I am also attaching extension screenshot:

As of 2014-10-05, the easiest way to run multiple versions or instances of Chrome is to use Google Chrome Portable, downloaded from:
http://portableapps.com/apps/internet/google_chrome_portable
Currently I'm running 4 separate instances of Google Chrome v37.0.2062.124. One instance is installed and three other instances of Google Chrome are portable.
Here's how my Windows 7 Taskbar looks like when all 4 instances of Chrome are opened:
http://image.bayimg.com/a024621496637cbdc2ad85324ed5e8e07b9f5453.jpg
If you want to change Google Chrome icon that is shown on the Windows Taskbar once Google Chrome is started, then you should follow this link:
https://superuser.com/questions/613851/is-it-possible-to-customize-taskbar-icons-if-so-how
The answer is given in comments: you need to change icons that are stored in chrome.dll using Resource Tuner (use Trial version) or Resource Hacker (free).
When you run totally separate instances of Chrome, you can make those separate Chrome instances use different proxies through Chrome settings of that particular instance of Chrome.

You can make multiple "people" (settings > manage other people > add person). You can then open a instance for each person(you don't have to login to google for the other "people"). Then you can configure a proxy for that instance.
To get the menu that's shown in the picture just click on your profile icon on the top right.

Related

Is there a way to combine chrome arguments with user profile?

I am trying to test around a webcam using fake stream, however, there is a check to see if the camera settings is allowed before it can work.
I am working with testcafe and my code is similar to what is below which doesn't work for the args (unless without the profile).
Using --use-fake-ui-for-media-stream and --use-file-for-fake-video-capture works for stream, however the check for camera settings still fails. I tried using a user profile which works for the camera settings but not the chrome arguments. Does anyone know how I can combine these two to work ?
chrome:userProfile --start-fullscreen --allow-insecure-localhost --use-fake-device-for-media-stream --use-fake-ui-for-media-stream --use-file-for-fake-video-capture="/path/to/video.y4m" ')
Chrome can't apply CLI flags without creating a new browser instance and can't create a new browser instance if you have other Chrome instances that use the same profile.
If you want to use "chrome:userProfile" together with CLI flags, you can close all Chrome processes on your machine. Or you can create a dedicated directory for a temporary Chrome profile and use it in tests by specifying chrome --user-data-dir=$TEMP_PROFILE_DIRECTORY as a browser.

Chrome's map to file system resource not working after update

I can add a folder to the workspace (which doesn't seem to do anything, as far as I can tell), but the "map to file system resource" option seems to have been removed, and I can no longer live-edit css files.
Is this a bug, or has the process for mapping css files been changed?
This talk (https://developers.google.com/web/updates/2017/10/devtools-release-notes) says that the new version uses "magic" to map remote files to local ones, but I can't seem to get it to work at all.
For reference, I'm trying to map a reddit css file to one on my own computer. It worked fine on a previous version of Chrome (basically I add the folder, and map the css file inside it, which has been renamed to have the same name as the remote one) but not on the new one (Chrome 63)
I've just fiddled around with a problem, where only some files got mapped to my local workspace.
Turned out that Google Chrome also checks and compares the last modified date of your files.
If the file on the server has a more recent date than your local copy, this file won't be mapped.
I deleted the Bootstrap file on the server side and uploaded my local copy, which has an older last modified date. Google Chrome instantly mapped the file to my local workspace.
Out of curiosity I ran touch bootstrap.min.js on my server to set the last modified date to today. This broke my file mapping again.
Chrome removed manually mapping to filesystem resources because of the new Workspaces 2.0 (See: https://developers.google.com/web/updates/2017/10/devtools-release-notes).
You should be able to drag and drop your folder into the sources tab and it'll link the files automagically.
However automatic mapping doesn't work in many situations and there is a Chrome bug to re-add manual mapping
I had the same problem so I downgraded to Chrome 62 (preferences, history, extensions and so on are preserved).
Download Chrome 62 from
https://www.slimjet.com/chrome/google-chrome-old-version.php .
On OS X trash /Applications/Google Chrome.
Switch off auto-update by setting "defaults write com.google.Keystone.Agent alwaysPromptForUpdates 1". Default is 0.
May be you have to set "defaults write com.google.Keystone.Agent checkInterval 0" too. Default is 18000.
Install Chrome 62 as usual.
After starting Chrome 62 open "About Google Chrome". Chrome is checking for updates, but will prompt you to confirm.
The "Map to File System Resource..." menu item is missing. There appears to be no way to map files. It is completely broken as far as I can tell.
For me, the problem turned out to be the presence of the copyright symbol © in the file headers (which affected just about every file). With this character in the files, devtool refused to map the files but with it removed, the files map fine.
I'm also using Chrome 63.0.3239.132 (Official Build) (64-bit) and as I wanted to use the DevTools Live-edit to edit some js files I saw that the option "Map to file system resource" is missing.
After some research I have found out that the Live-edit is perfectly working in Version 63, you just have to:
go to Sources and then FileSystem
add the folder with your code to the workspace
After that, a small little green point will be displayed near your files (it means the synchronization is ready) and the changes via DevTools can be persisted locally:
Thanks to others in this thread saying chrome is checking the modified date.
Adding this to .htaccess solved it for me
IndexOptions SuppressLastModified
Of course you would not want this to get into your production code as it could stop browser caching working.
I cleared the cache and it works now.
Previously, I opened my CSS file from my FTP client, then I dragged the containing folder into the Sources tab > Filesystem tab (without caring about any folder names nor structure, I just dragged the FTP clients containing folder into it).
The persistent mapping worked straight away, edits from the Chrome Dev Tools were saving on the server. After 30 minutes of fiddling and playing around, it just stopped working and the CSS resource got greyed out. The file icon with the green dot was not appearing anymore.
It didn't matter what I'd do, it would not work, but when I cleared my cache, it started to work again.
File mapping started working reliably for me once I turned on a devtools setting -- click the upper-right gear icon and check Preferences > Network > "Disable cache (while DevTools is open)"
As of today, with Chrome Version 63.0.3239.108 (Official Build) (64-bit):
The feature appears to be still broken, not working 'automagically' nor consistently with the previous behavior.
However, adding a folder that reflects the resource's URL as seen in the Network tab, make it work again. So if for instance, in the Network Navigator tab you have:
http://mylocal.site/wp-content/themes/mytheme/assets/sass/partials/_header.scss
You will just need to add the whole wp-content/ folder to the Filesystem tab to get the feature work again as expected.
Had the same problem, but when my source maps included sourcesContent, the file mappings were automatically made and I could live edit my scss. Apparently chrome uses the content to find the right file.
node-sass --source-map-contents

"unsafely-treat-insecure-origin-as-secure" flag is not working on Chrome

I am using geo-location for a site running locally on my machine using HTTP on Chrome. However this does not work as I am running on HTTP as opposed to HTTPS.
On the console it says:
getCurrentPosition() and watchPosition() no longer work on insecure origins.
To use this feature, you should consider switching your application to a
secure origin, such as HTTPS. See https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins
for more details.
Accoriding to Deprecating Powerful Features on Insecure Origins its says to start chrome using --unsafely-treat-insecure-origin-as-secure="http://example.com" flag. The command I ran was similar to:
chrome.exe --unsafely-treat-insecure-origin-as-secure="http://hello.app"
However, the same error message still appears.
How can I fix this issue.
None of the solutions worked for me.
I achieved this by following steps.
Type chrome://flags/#unsafely-treat-insecure-origin-as-secure in the address bar.
Add the origin which you need to treat as secure as shown in the below image.
Relaunch chrome.
You must have missed some steps. Try to follow this
Go to File Explorer then paste this to address bar >> C:\Program Files (x86)\Google\Chrome\Application (or just go to where you can find your chrome.exe)
Right click chrome.exe > send to > Desktop (Create Shortcut)
Go to your desktop then find the chrome shortcut you've created.
Rename it to ChromeForTesting (this step is optional)
Right click the shortcut, then Click Properties
At the "Target", paste the following at the end of the link
--user-data-dir=/tmp/foo --unsafely-treat-insecure-origin-as-secure=http://example.com
so Target should look somewhat similar to this
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=/tmp/foo --unsafely-treat-insecure-origin-as-secure=http://example.com
Click Ok..
During testing close all of your opened google chrome browser.
Then double click ChromeForTesting shortcut (the one you've created), when a prompt appears, just click ok..
EDIT: If the steps above does not work for you, you might be using Chrome V63, update it to V64 above cause this flag is messed up in V63.
P.S. If it's still not working follow these extra steps
At your drive C, create a folder and name it "ChromeTempFiles".
Then in your --user-data-dir= you change the value into "C:\ChromeTempFiles"
Add these to your target as well
--allow-running-insecure-content --reduce-security-for-testing
so your target should look like this now
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=C:\ChromeTempFiles --unsafely-treat-insecure-origin-as-secure=http://example.com --allow-running-insecure-content --reduce-security-for-testing
You should also use a temproary fresh profile for that session. something like this:
chrome.exe --user-data-dir=/test/only/profile/dir --unsafely-treat-insecure-origin-as-secure="http://example.com"
Just an update to this for Chrome 70. This works perfectly
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=C:\ChromeTempFiles --allow-running-insecure-content
Now does anybody know if there is an equivalent for firefox?
For Chromium 44 use
--unsafety-treat-insecure-origin-as-secure=http://192.168.0.101:3000
instead
--unsafely-treat-insecure-origin-as-secure=http://192.168.0.101:3000
See that bug
In Google Chrome, you simply type into the address bar, "chrome://flags", and search for, "--unsafely-treat-insecure-origin-as-secure", enable that flag, and enter into the field below (multiples may be entered separated by a comma) the domain you wish to treat as secure. This may or may not compromise your security, but I would assume not as getCurrentPosition() and watchPosition() are somewhat recently deprecated features. this works for publicly served domains, as well.
With Chrome 79 this setting doesn't work no matter what.
What I ended up doing was to configure the domain on a VPS to show some test webpage and then generate a valid certificate for it using Let's Encrypt's certbot.
Then I copied that certificate to my machine and it's now valid.

How do I make the Google Chrome flag “--allow-file-access-from-files” permanent?

" google-chrome --allow-file-access-from-files "
Like i have an app,that requires chrome to have this security restriction on local files removed.
So i cant type do this everytime i take the app.
Any ideas?
PS: It would be great if you can tell what the positives and negatives about it,as well as how to revert back if needed.
On Linux Operating System (specifically UBUNTU)
Slightly Permanent Method
Go to the menu entry/ launcher for Chrome (.desktop file)
Open the launcher properties dialog.
It should look something like this: ‘/usr/bin/google-chrome %U’
Change it to ‘/usr/bin/google-chrome --allow-access-from-files‘ to
make the flags work permanently
You may also need to delete and re-pin your launcher(s) after
modifying it. Chrome should launch with the specified flags enabled
after the modification.
PS: I found this here, haven't tried this out..

Where does PERSISTENT file system storage store with chrome?

When doing webkitRequestFileSystem in window.PERSISTENT option in Google Chrome, where on my filesystem do files get written? I'd like to drop files there and have Chrome interact with them while I'm building and debugging this app.
For me, at least on Mac OSX, they're stored under /Users/USERNAME/Library/Application Support/Google/Chrome/Default/File System for me. If you're using profiles, there will be profile directories instead of Default. However, each origin's saved files/folders are obfuscated under directories that won't be easy for you to interact with.
For debugging the Filesystem API, you have a few options:
Use this extension to view/remove files.
See the tips here: http://updates.html5rocks.com/2011/08/Debugging-the-Filesystem-API
That includes viewing stored files very easily using the filesystem: URLs.
Drop the Filesystem Playground demo (http://html5-demos.appspot.com/static/filesystem/filer.js/demos/index.html) into your origin. You can use that to view/rename/delete files/folders easily.
Chrome DevTools now has support for the Filesystem API for viewing the files stored under an origin. To use that, you will need to enable the Developer Tools experiments in about:flags, restart, hit the gear in the devtools (lower right corner), and enable the 'FileSystem inspection' under the experimental tab.
Just for completeness: on linux it goes into ~/.config/google-chrome/Default/File\ System/
On Windows XP, it is here: c:\Documents and Settings\USERNAME\Local Settings\Application Data\Google\Chrome\User Data\Default\File System\.
On Windows 7, the location is C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\File System.
It's not very useful to browse it because file and dir names are obfuscated (but content in files is unchanged).
As ebidel wrote the best way is using browser of filesystem: urls that incorporated into Chrome. It's excellent! You can get the url using fs.root.toURL() where fs is a FileSystem object that you get, for example, from window.webkitRequestFileSystem().
Seems like the filesystem storage is encoded to prevent exactly what was trying to do. I ended up writing a very simple file manager available here. Start up any web server (I like mongoose for its 0 setup) and go to the /filemanager.html route
I saved a file called log.txt on MAC
It ended up at
~/Library/Application\Support/Google/Chrome/Default/Storage/ext/panbljeniblfmcakpphmjmmnpcaibipi/def/File\ System/iso/p/00/
with file name 00000 and no ext
If you are using MAC OX, and you have more than one profile on your chrome, or you cannot find default in the path, replace default with profile. But depending on number of profiles you have, it could be profile 1, profile 2, etc