How to run chrome in debug mode with current user profile? - google-chrome

I can do this, if no chrome running on my machine. But if one instance is already running, this command just open a new window without debugging.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
And in this case I can start chrome only if specify --user-data-dir.
I tried
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=/Users/nazarkalituk/Library/Application\ Support/Google/Chrome/Default
but it didn't help.

You essentially want to set your userDataDir to false in your launch.json. Here is an image of how it would look.
How to set the UserDataDir to false
It will take you the current profile you are currently in.
If it fails to connect to the current profile, or if you want a better option entirely, I recommend going to these links for more info:
https://briandesousa1.wordpress.com/2018/05/12/using-a-chrome-developer-profile-with-visual-studio-code-debugger/
run vscode chrome debugger with its extensions

Related

How to enable remote debugging in Chrome headless browser?

As per details given in chrome://version/
Command Line : /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary --flag-switches-begin --flag-switches-end
Executable Path : /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary
If I try to run the executable path directly, I am able to see no file or directory
rajamuhamm.qaiser$ /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary -bash: /Applications/Google: No such file or directory
It shows an error because of <space> in the directory naming structure.
So I modified my command a bit to
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --headless -disable-gpu -screenshot https://google.com
It actually works, Now that I wanted to take PDF of it, I ran below
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --headless -disable-gpu –print-to-pdf https://google.com
which returned
:ERROR:headless_shell.cc(184)] Open multiple tabs is only supported when remote debugging is enabled.
Before posting the question, I tried to search for other solutions in Stackoverlow and all they answered is to check for issues in the spacing of directory naming. But seems my case is different, as I am able to run the command but it required me to enable remote debugging.
Can you please share me how? I Google but I am not able to find much

How to disable CORS in chrome to work with localhost and third party url on window 11 Chrome

I want to access https://third-party-url/ from my localhost But chrome is throwing cors error
I am using window 11 and chrome version : Version 106.0.5249.103 which is latest version till 2022-10-10
Run cmd from Chrome's path.
chrome.exe --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
This command is only disable cors in the window that opens after running the command. If you close this window, you can use the same command again.

What is the exact command for launching Chrome with remote debugging in Terminal?

I've looked up and tried a couple ways of launching Chrome with remote debugging through the terminal, and neither have worked. I get the error "no such directory" or command not found. I've tried:
chrome --remote-debugging-port=9222
and
/Applications/Google\Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
Are either of these correct? And if not, what is the right command?
One simple change is needed, add the bash shebang to the Chrome Debugger script.
#!/bin/bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222&

Does headless Chrome auto update?

Does Chrome update itself when running in headless mode by selenium?
It seems, it is not updating, probably because of --disable-background-networking switch set by Selenium by default. I want to ensure that's indeed the case. If there any reference in documentation explaining either auto-update behavior or meaning of switches and their impact? So far best I've found is list with all command line Chrome switches with some comments, but it is still not clear.
No, Chrome Browser Client doesn't update itself when running in headless mode by selenium.
As per Getting Started with Headless Chrome the Headless Chrome is the server environment where you don't need a visible UI shell.
If you've got Chrome 59+ installed, you start Chrome with the --headless flag as follows:
chrome \
--headless \ # Runs Chrome in headless mode.
--disable-gpu \ # Temporarily needed if running on Windows.
chrome should always point to your installation of Chrome. Of course, the exact location varies from platform to platform.
So until and unless the original Chrome Browser is automatically/manually updated, Chrome Browser Client doesn't get updated.
TL;DR
--disable-background-networking is configured to disable several subsystems which run network requests in the background. This is used when performing network performance testing in order to avoid noise in the measurements.

chrome.exe command line parameters for kiosk mode

I'm using chrome.exe version: 29.0.1547.66 m on a w7 pc.
I'd like to use command line parameters like --kiosk from the command prompt when starting chrome.
I found a list of switches here: http://peter.sh/experiments/chromium-command-line-switches/
When I type in:
chrome.exe --kiosk http://somesite.com
Chrome starts, it opens up the specified url, but not in kiosk mode.
It seems to ignore the --kiosk command. If I try --help as a flag, it gets ignored as well.
Is this supported on chrome.exe on windows? Should the commandline interface be enabled first somehow? Any thoughts?
Thanx in advance,
Paul
Problem solved ... also thanks to the post of ComFreek .... problem was about running instances of chrome.
As soon as I closed all running chrome instances before invoking chrome, the commandline options started to work.
--chrome-frame worked for me:
"c:\progra~2\Google\Chrome\Application\chrome.exe" --chrome-frame --kiosk http://foldoc.org/pub/misc/automata.html