Chrome command-line arguments do not work on Windows 10 - google-chrome

I am attempting to send command-line arguments to Chrome in order to disable CORS support and allow local file access. For some reason it works under Mac OS X and not Windows. I am attempting the following commands:
C:\>cd "Program Files (x86)"\google\chrome\application
C:\Program Files (x86)\Google\Chrome\Application>chrome --args --allow-file-access-from-files --disable-web-security
I am also attempting the same command without the --args flag.

I had to use:
.\chrome.exe
Windows was looking in my system PATH for the binary and this messed up the parameter passing.

Related

How can I run my tests with older chrome version in cypress

Now my cypress version is 3.8.2
And when I am opening cypress window there are chrome version is 79.
I want to run my tests in chrome 70 version. I updated my chrome in my computer and now it 70 version.
When I am running my test with selected command
npx vue-cli-service test:e2e --headless --browser chrome
Test is running in Chrome 79. How can I change my chrome version for running.
As per the documentation, the default chrome location to be auto-detected by cypress is "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe". If the other version of chrome is installed in a different location, I guess the available options are to uninstall both 79 & 70 and clean install 70 first to the above said location and later installing 79 to a different location (OR) uninstall 79 (assuming it installed in default location) and re-install to a different location than the default, and finally set a symbolic link to version 70 on the default location something like (which requires admin previleges on the machine, though). This way cypress scans the default location and gets whichever version pointing to the symbolic link.
mklin "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "path to ver70 exe"
But before all, I think the command parameters appear to be slightly off, can you try instead (making sure the path is pointing to the verion 70, not the default one)
npx vue-cli-service test:e2e --headless --browser "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
I suspect --headless is default for a 'cypress run' command command, if your test:e2e is something like "cypress run", then you can simply omit it.
The --browser command supports launching any supported browser by specifying a path to the binary.
So in your case try: npx vue-cli-service test:e2e --headless --browser /usr/bin/chromium
where /usr/bin/chromium is the path for the binary of your needed version of Chrome.

Headless chrome print to pdf hangs on certain sites when running on debian

I am trying to use Headless chrome to print to pdf on debian 9.
On some sites it hangs and never returns with an error.
When trying to do the same on Windows 10 it works.
Example site: https://www.ynet.co.il/home/0,7340,L-8,00.html
Turning on logging does not reveal any relevant information.
I am assuming it has something to do with fonts but since it hangs and return no error i am not sure how to proceed.
Is there some to understand why it hangs?
Setup on debian:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
Creating pdf on debian:
/usr/bin/google-chrome --headless --no-sandbox --disable-gpu --displayHeaderFooter=false --print-to-pdf=result.pdf https://www.ynet.co.il/home/0,7340,L-8,00.html
Creating pdf on windows (need to install google chrome and change the path to it accordingly):
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --no-sandbox --disable-gpu --displayHeaderFooter=false --print-to-pdf=result.pdf https://www.ynet.co.il/home/0,7340,L-8,00.html

Chrome headless immediately exits with --repl flag

I'm trying to use the chrome.exe headless REPL, but it seems to immediately exit.
I'm currently on Windows 7 Pro 64-bit
Chrome Version 72.0.3626.121
Command Used:
$ chrome.exe --headless --disable-gpu --enable-logging --no-sandbox --repl https://www.chromestatus.com/
Result
As you can see below it almost looks like I am able to start using the REPL, except there is no >>> .
$ [0307/131904.237:INFO:headless_shell.cc(370)] Type a Javascript expression to evaluate or "quit" to exit.
If i were to type a javascript expression:
$ [0307/132502.083:INFO:headless_shell.cc(370)] Type a Javascript expression to evaluate or "quit" to exit.
const someNumber = 1
'const' is not recognized as an internal or external command,
operable program or batch file.
$
It appears chrome has already exited. I've tried this in cmd.exe, PowerShell and ConEmu all with the same result. This is my first time with chrome headless so I apologize if the answer is obvious.
Chrome's official blog recommends two methods users can use to keep chromium from exiting after being launched from the command line. The blog explicitly and repeatedly mentions windows in their instructions so I assume they apply to the windows version of chrome as well:
Start the browser with remote debugging enabled by passing --remote-debugging-port=PORTNUM at the command line, or
Start chrome in REPL mode by passing --repl at the command line. This will cause chromium to persist as long as stdin remains open.
I've tested both approaches and can attest to both approaches working with Chromium 108.0.5359.124 on Linux as of the time of this writing. For the sake of completeness, I've included the exact commands I used to confirm this bellow:
Remote Debugging
chromium --headless --temp-profile --password-store=basic --disable-gpu --remote-debugging-port=9222 https://example.com
REPL Mode
chromium --headless --temp-profile --password-store=basic --disable-gpu --remote-debugging-port=9222 https://example.com

How do I tell the Compute Engine gcutil-tool the location of a file when doing a push/pull?

gcutil does not understand when I use "d:/documents and settings/paul/desktop/somefile.txt"
I am using Cygwin terminal with Windows Xp.
Cygwin uses Unix-style paths, which do not have explicit drive letters.
Try /cygdrive/d/Documents and Settings/...
With my Windows XP is so that D:\cygwin\home\exampleusername\examplefile.txt can be referenced as ~/examplefile.txt from the cygwin command line.
And I can get files from the Linux instance when I am at my local command prompt: I can "gutil ... pull ..." files from the instance and "gcutil ... push ..." files to instance.
Push or pull at the Linux instance command prompt does not work, I think this is a issue with my local firewall.

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