I have 2 chrome profiles. My aim is to control these 2 windows using puppeteer. So first, I have to open these profile windows via command line, specifying the debugging ports.
command 1: google-chrome --remote-debugging-port=9222 --profile-directory="Default"
command 2: google-chrome --remote-debugging-port=9223 --profile-directory="Profile 1"
When 1st command is executed, it opens a chrome window with the profile I mentioned. And I also get a WS URL for that browser. So I can use that in puppeteer.
Problem is while running second command. It also opens the profile, but no URL. It says "Opening in existing browser session".
I want to open more profiles and control them with puppeteer. Please help.
You can open a URL in chrome from the command line with
chrome.exe https://google.com
but when trying to do like chrome.exe chrome://version, it simply opens an empty page.
It seems that the chrome protects the privileged pages from abnormal behavior.
Is there any way to open the privileged pages from command line?
I am trying to debug an application but it throws same origin policy error.
So I followed ticket
Disable same origin policy in Chrome
However when ever I start chrome with CC:\Program Files\Google\Chrome\Application\chrome.exe" --args --disable-web-security from cmd, it is not starting in non-secure mode and it also doesn't show a notification that says that chrome is running in non secure mode.
I have disabled all the extensions too for this.
Please help.
Remove --args, start Chrome or Chromium as follows:
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security
This flag is quite dangerous, I suggest to start up a separate profile to avoid leaking confidential information from one website to another:
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%TMP%\profiledirname
And if you want to load an unpacked extension, use the --load-extension flag (multiple extensions can be loaded by separating the paths by a comma):
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%TMP%\profiledirname --load-extension="C:\Users\My User\Documents\My extension"
It seems that --disable-web-security is not supported anymore...
Chromium 38 says (translated from spanish) "--disable-web-security option is not accepted because it affects security and stability" :-(
You don't need --args to use --disable-web-security but it seems that since Chrome 38 even enabling that parameter does not allow CORS without the proper header.
See: https://code.google.com/p/chromium/issues/detail?id=392170
I am trying to access some local files via jqueryMobile, it works fine in Firefox and IE but Chrome gives a security exception. I can open Chrome in disabled security mode to access local files by using
C:\Program Files\Chrome\Chrome.exe --disable-web-security
or run it via this
chrome.exe --disable-web-security
but is there any way I can create a shortcut on desktop that will always open Chrome in disabled security mode?
Just clone the shortcut for chrome you have on your desktop, and then in the shortcut properties add the parameter --disable-web-security (and --user-data-dir) at the end of chrome executable path
e.g
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\tmpChromeSession"
Edit #1 : I changed google chrome path, the old one was not correct.
I just tried it on XP with fresh Chrome installed, but i got a error message that this flag is not supported.
Edit #2 : http://peter.sh/experiments/chromium-command-line-switches/
First search Run, then try this:
chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security
just a quick update, now you need not only --disable-web-security but --user-data-dir
to sum it up:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir
You must use the following flags
--disable-web-security
--user-data-dir
but also pass the path to your chrome user profile
See this:
https://productforums.google.com/forum/#!topic/chrome/9nHBcjNW384
https://bugs.chromium.org/p/chromium/issues/detail?id=575690
So now i have top pass my user profile path:
C:\Users\user\projects\project>"C:\Program Files (x86)\Google\Chrome\App
lication\chrome.exe" --disable-web-security --user-data-dir="C:\Users\user\A
ppData\Local\Google\Chrome\User Data\Default"
For MAC (ios)
Run following command in terminal.
open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security
It's working You have to add that parameter --disable-web-security in Target location after one space
Goto window search type Run
then on the run popup
just paste "chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security "
and ok || worked for me :)
Now it's
--disable-web-security --user-data-dir="c:/someFolderName"
chrome security command
for windows open run->than paste this command and make sure you have to close all windows before run this command
"chrome --disable-web-security --user-data-dir"
For Windows10:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\temp"
For Ubuntu,
google-chrome --args --disable-web-security --user-data-dir="Path_To_Project_Directory"
Creating Google Chrome
Ubuntu
Windows10
chrome.exe --disable-web-security --user-data-dir=c:\my-chrome-data\data
Why don't you try with Safari browser? It is simple to disable web security over there.
Simply click on
Develop > Disable Cross-Origin Restrictions
in the menu bar.
In order to get Develop menu, do the following:
Preferences > Advanced > Show Develop menu in menu bar.
I'm trying to test out some code for accessing a webcam on an HTML page and Chrome doesn't seem to allow me to. I made an exception for the file and yet everytime I reload (which it tells me will put the settings in effect) it goes back to blocking it
Go to:
chrome://flags/#unsafely-treat-insecure-origin-as-secure
Add your url there and enable this flag, relaunch and it should work.
You can open chrome with the flag disable-web-security
For Mac, in terminal:
open -a /Applications/Google\ Chrome.app/ --args --disable-web-security
For a PC in console:
chrome.exe --disable-web-security