Chrome's --auto-open-devtools-for-tabs - google-chrome

I'm trying to get the devtools to open automatically when starting chrome from a shortcut with a command line switch --auto-open-devtools-for-tabs.
i.e. the path of that shortcut is: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -incognito -auto-open-devtools-for-tabs (or --auto-open-devtools-for-tabs).
But both don't seem to open the dev tools, neither does entering in the cmd chrome.exe -auto-open-devtools-for-tabs (or --auto-open-devtools-for-tabs), of course when in Chrome's folder.
Maybe I'm doing something wrong?
The command is from:
http://peter.sh/experiments/chromium-command-line-switches/#auto-open-devtools-for-tabs
https://stackoverflow.com/a/41452619/4279201

This flag only applies when you open the first chrome instance.
Close all chrome windows
Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -incognito -auto-open-devtools-for-tabs
If you want your daily browser, with all tabs but without devtools, at the same time as you're debugging a website with devtools automatically opening, you have to run them separately.
Alternative: Stable + Beta
One example is to use example Chrome stable and Chrome beta.
"C:\Program Files\Google\Chrome\Application\chrome.exe"
"C:\Program Files\Google\Chrome Beta\Application\chrome.exe" --auto-open-devtools-for-tabs
Alternative: data-dir
"C:\Program Files\Google\Chrome\Application\chrome.exe" -incognito --auto-open-devtools-for-tabs --user-data-dir="%APPDATA%\ChromeDevOrAnyName"

Related

How open Chrome without url field from shortcut

Are there anyway to open Chrome without url field from shortcut? What flags ara neccesary to open it? Commnad line flags (Windows)
I know that I can open Chrome from command line in new tab: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://marcodetrabajo.com"
I need it without url field, only web content.
Info: link
Maybe, with another browsers?
Thanks
I solved the problem. The solotion in Chrome browser is:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app=http://example.com
No flags are needed. Just open CMD and type:
start chrome example.com
If you want to open multiple pages in multiple tabs:
start chrome \example.com \google.com

Edit chrome command line args

When I type in chrome://version there's a box that looks like this:
Command Line: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --extensions-on-chrome-urls --test-type --load-extension="c:\Program Files\Google\Chrome\Application\Extensions\chrome\app\37.1329.15.30" --load-component-extension="c:\Program Files\Google\Chrome\Application\Extensions\chrome\man" --flag-switches-begin --flag-switches-end
It seems to be loading an unwanted extension, and I always have to go uninstall "Max Adblock" from the extension devtools app. Can I edit the builtin command line args to stop it from loading this extension?

Creating Google Chrome shortcut with --disable-web-security

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.

Chrome won't allow local camera access

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

Does --disable-web-security work in Chrome?

I'm trying to do a simple test without changing any server-side code involving a cross-domain AJAX call, and I was wondering if it's possible to use --disable-web-security anymore. It seems to not work on Chrome 28.
I haven't used it since Chrome version 21; has this feature been dropped?
Check your windows task manager and make sure you kill all chrome processes before running the command.
The new tag for recent Chrome and Chromium browsers is :
--disable-web-security --user-data-dir=c:\my\data
Try this :
Windows:
Run below commands in CMD to start a new instance of chrome browser with disabled security
Go to Chrome folder:
cd C:\Program Files (x86)\Google\Chrome\Application
Run below command:
chrome.exe --disable-web-security --user-data-dir=c:\my-chrome-data\data
MAC OS:
Run this command in terminal:
open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_sess_1" --disable-web-security
Hope this will help both Windows & Mac users!
This flag worked for me at v30.0.1599.101 m
The warning "You are using an unsupported command-line flag" can be ignored. The flag still works (as of Chrome v86).
This should work. You may save the following in a batch file:
TASKKILL /F /IM chrome.exe
start chrome.exe --args --disable-web-security
pause
Open target location of chrome and navigate through cmd
type
chrome.exe --disable-web-security --user-data-dir=c:\my\dat
Just create this batch file and run it on windows. It basically would kill all chrome instances and then would start chrome with disabling security. Save the following script in batch file say ***.bat and double click on it.
TASKKILL /F /IM chrome.exe
start chrome.exe --args --disable-web-security –-allow-file-access-from-files
Check if you have Chrome App Launcher. You can usually see it in your toolbar. It runs as a second instance of chrome, but unlike the browser, it auto-runs so is going to be running whenever you start your PC. Even though it isn't a browser view, it is a chrome instance which is enough to prevent your arguments from taking effect. Go to your task manager and you will probably have to kill 2 chrome processes.
As you can't run --disable-web-security and a normal chrome in parallel it's probably a good solution to use Opera for --disable-web-security
Here is how to create a launcher for opera on windows. By the way, Opera has the same debugging tools as chrome!
http://www.opera.com/
:: opera-browse-dangerously.bat
cd c:\Program Files\Opera\
launcher.exe --disable-web-security --user-data-dir="c:\opera-dev"
PS: Opera doesn't display any notification when started without web-security
If you want to automate this:
Kill chrome from task Manager First. In Windows - Right Click (or Shift+right click, in-case of taskbar) on Chrome Icon. Select Properties. In "Target" text-box, add --disable-web-security flag.
So text in text-box should look like
C:\Users\njadhav\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --disable-web-security
Click Ok and launch chrome.
just run this command from command prompt and it will launch chrome instance with CORS disabled:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
Automated solution for Windows 10
Right-click on Chrome icon > right-click Google Chrome > Properties
Shortcut > Target > "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\ChromeDevSession"
Notes:
Your file path for chrome.exe may vary.
Also, the --user-data-dir flag is required, and its file path may vary. Besides C:\ChromeDevSession, another possible location is ~/chromeTemp
Now Chrome always has its web security disabled :-)