Run chrome in fullscreen mode on Windows - google-chrome

I want to configure my computer to launch Google Chrome Windows start up. It should start in full screen mode and open some web page.
I tried to run Chrome with the following command line:
chrome.exe --start-fullscreen --app=https://google.com
However Chrome opens in windowed mode, not in full screen mode.
Is there any way to run chrome in full screen mode?

Update 03-Oct-19
new script that displays 10second countdown then launches chrome/chromiumn in fullscreen kiosk mode.
more updates to chrome required script update to allow autoplaying video with audio. Note --overscroll-history-navigation=0 isn't working currently will need to disable this flag by going to chrome://flags/#overscroll-history-navigation in your browser and setting to disabled.
#echo off
echo Countdown to application launch...
timeout /t 10
"C:\Program Files (x86)\chrome-win32\chrome.exe" --chrome --kiosk http://localhost/xxxx --incognito --disable-pinch --no-user-gesture-required --overscroll-history-navigation=0
exit
might need to set chrome://flags/#autoplay-policy if running an older version of chrome (60 below)
Update 11-May-16
There have been many updates to chrome since I posted this and have had to alter the script alot to keep it working as I needed.
Couple of issues with newer versions of chrome:
built in pinch to zoom
Chrome restore error always showing after forced shutdown
auto update popup
Because of the restore error switched out to incognito mode as this launches a clear version all the time and does not save what the user was viewing and so if it crashes there is nothing to restore. Also the auto up in newer versions of chrome being a pain to try and disable I switched out to use chromium as it does not auto update and still gives all the modern features of chrome. Note make sure you download the top version of chromium this comes with all audio and video codecs as the basic version of chromium does not support all codecs.
Chromium download link
#echo off
echo Step 1 of 2: Waiting a few seconds before starting the Kiosk...
"C:\windows\system32\ping" -n 5 -w 1000 127.0.0.1 >NUL
echo Step 2 of 5: Waiting a few more seconds before starting the browser...
"C:\windows\system32\ping" -n 5 -w 1000 127.0.0.1 >NUL
echo Final 'invisible' step: Starting the browser, Finally...
"C:\Program Files (x86)\Google\Chromium\chrome.exe" --chrome --kiosk http://127.0.0.1/xxxx --incognito --disable-pinch --overscroll-history-navigation=0
exit
Outdated
I use this for exhibitions to lock down screens. I think its what your looking for.
Start chrome and go to www.google.com drag and drop the url out onto the desktop
rename it to something handy for this example google_homepage
drop this now into your c directory, click on my computer c: and drop this file in there
start chrome again go to settings and under on start up select open a specific page and set your home page here.
Next part is the script that I use to start close and restart chrome again in kiosk mode. The locations is where I have chrome installed so it might be abit different for you depending on your install.
Open your text editor of choice or just notepad and past the below code in, make sure its in the same format/order as below. Save it to your desktop as what ever you like so for this example chrome_startup_script.txt next right click it and rename, remove the txt from the end and put in bat instead. double click this to launch the script to see if its working correctly.
A command line box should appear and run through the script, chrome will start and then close down the reason to do this is to remove any error reports such as if the pc crashed, when chrome starts again without this it would show the yellow error bar at the top saying chrome did not shut down properly would you like to restore it. After a few seconds chrome should start again and in kiosk mode and will point to what ever homepage you have set.
#echo off
echo Step 1 of 5: Waiting a few seconds before starting the Kiosk...
"C:\windows\system32\ping" -n 31 -w 1000 127.0.0.1 >NUL
echo Step 2 of 5: Starting browser as a pre-start to delete error messages...
"C:\google_homepage.url"
echo Step 3 of 5: Waiting a few seconds before killing the browser task...
"C:\windows\system32\ping" -n 11 -w 1000 127.0.0.1 >NUL
echo Step 4 of 5: Killing the browser task gracefully to avoid session restore...
Taskkill /IM chrome.exe
echo Step 5 of 5: Waiting a few seconds before restarting the browser...
"C:\windows\system32\ping" -n 11 -w 1000 127.0.0.1 >NUL
echo Final 'invisible' step: Starting the browser, Finally...
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --overscroll-history-navigation=0"
exit
Note: The number after the -n of the ping is the amount of seconds (minus one second) to wait before starting the link (or application in the next line)
Finally if this is all working then you can drag and drop the .bat file into the startup folder in windows and this script will launch each time windows starts.
Update:
With recent versions of chrome they have really got into enabling touch gestures, this means that swiping left or right on a touchscreen will cause the browser to go forward or backward in history. To prevent this we need to disable the history navigation on the back and forward buttons to do that add the following --overscroll-history-navigation=0 to the end of the script.

It's very easy.
"your chrome path" -kiosk -fullscreen "your URL"
Example:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -kiosk -fullscreen http://google.com
Close all Chrome sessions first !
To exit:
Press ALT-TAB > hold ALT and press X in the windows task. (win10)

I would like to share my way of starting chrome - specificaly youtube tv - in full screen mode automatically, without the need of pressing F11. kiosk/fullscreen options doesn't seem to work (Version 41.0.2272.89). It has some steps though...
Start chrome and navigate to page (www.youtube.com/tv)
Drag the address from the address bar (the lock icon) to the desktop. It will create a shortcut.
From chrome, open Apps (the icon with the multiple coloured dots)
From desktop, drag the shortcut into the Apps space
Right click on the new icon in Apps and select "Open fullscreen"
Right click again on the icon in Apps and select "Create shortcuts..."
Select for example Desktop and Create. A new shortcut will be created on desktop.
Now, whenever you click on this shortcut, chrome will start in fullscreen and at the page you defined. I guess you can put this shortcut in startup folder to run when windows starts, but I haven't tried it.

Running chrome.exe --start-fullscreen --app=https://google.com will not get you Chrome in fullscreen, but in kiosk mode.
However, running chrome --start-fullscreen --app=https://google.com (notice : it's chrome instead of chrome.exe) worked in my case.

You can also add --disable-session-crashed-bubble to eliminate the errors that come up after a crash or improper shutdown.

Right click the Google Chrome icon and select Properties.
Copy the value of Target, for example: "C:\Users\zero\AppData\Local\Google\Chrome\Application\chrome.exe".
Create a shortcut on your Desktop.
Paste the value into Location of the item, and append --kiosk <your url>:
"C:\Users\zero\AppData\Local\Google\Chrome\Application\chrome.exe" --kiosk http://www.google.com
Press Apply, then OK.
To start Chrome at Windows startup, copy this shortcut and paste it into the Startup folder (Start -> Program -> Startup).

Related

Run CloudEndPoints Explorer on Local HTTP

I'm trying to run the Api Explorer in LocalHost But it always show the Error
The API you are exploring is hosted over HTTP, which can cause problems.
So I follow the instruction
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=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
so Target should look somewhat similar to this
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
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..
But After compelting this When I run that shortcut it will give the error
you are using unsupported command line flag --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
I also try to click load unsafe script but this is also not working.
Here is screen shot.

How to enable chrome crash dump collection during automated testing?

I know how to enable chrome's crash reporting interactively:
Menu > Settings > Show advanced settings > Tick "Automatically send usage statistics and crash reports to Google"
However, I'm using chrome in an automated testing setup where we set a new --user-data-dir for each run (so there are no persisted settings, we just get the defaults). Chrome is crashing occasionally (running our javascript/html application) and I would like to be able to report these crashes.
I thought I could add --enable-crash-reporter (according to the List of Chromium Command Line Switches), but that doesn't seem to do anything. (We already pass --enable-logging and a couple other flags on the command line.)
I have a test that triggered an "Aw, Snap":
But if I download the user-data-dir for that run and and point chrome at it, and then visit chrome://crashes, it says crash dumps are not enabled.
(The chrome_debug.log does not say anything about the Aw-Snap either.)
We're running chrome under Xvfb on Debian. We're driving chrome via the direct webdriver (from Protractor).
According to the "crashpad with content shell" docs, the steps for using crashpad with content shell (a stripped down version of Chrome):
Create some directory for your crash dumps to go to (the docs suggest tmp/crashes on Linux and Mac, %TEMP%\crashes on Windows, and /data/local/tmp/crashes on Android)
Start Chrome with --enable-crash-reporter --crash-dumps-dir=<your_dump_dir> (looks like you got half of this)
So I'd try adding the --crash-dumps-dir flag.

Prompted by "Google Chrome didn't shut down correctly.... "

Using Google Chrome 38.0.2125.111 m in a Windows 7 environment. It is launched by a batch file & set to go to a specific (internal) URL. The Windows environment is going to be locked down, permitting only a handful of options available to the user.
Chrome is being used because IE will be accessing a different site. Without going into boring detail, using both sites on a single browser allowed a user to access an account that wasn't theirs. Both browsers will be launched using one of two batch files. The Chrome batch file supplies the username & password to bypass a login screen on that application.
To keep from opening multiple windows in Chrome, the following batch file is used:
taskkill /f /t /im chrome.exe > NUL
ping -n 3 127.0.0.1 > NUL
START /max chrome "http://myinternalwebsite?uid=x&pwd=y"
Taskkill is used to close chrome (/f = force /t = terminates process & any child ones /im = image name).
If the Chrome session is closed (using the X at the upper right corner of the screen), the batch file works fine. However, if there is already a chrome instance running, we get the yellow bar with the frowning folder & a message saying:
Google Chrome didn't shut down correctly. To reopen the pages you had
open, click Restore.
I have tried several command line options when launching Google Chrome, but none will keep the message from displaying. Ones I have tried are:
--disable-restore-session-state
--disable-session-crashed-bubble
--incognito
among others. I've experimented with some of the settings in Chrome, but none have (yet) worked. The --incognito option works - sort of. It keeps blocking plugins, one of which is Silverlight - one of the chief components for the website to function. Even though it does get rid of the message, it leaves the site not functioning properly.
The intent on using Taskkill to flush any existing Chrome sessions was to prevent the user opening up a dozen different Chrome instances of the same thing.
Is there any way to keep a user from opening multiple instances of Chrome that won't leave Chrome thinking it didn't close properly? Given the user restrictions, I'm not sure that a script/batch file to edit the Preferences file in the Chrome folder will work. An extension may be an option, but a third party application will not be.
Would appreciate any thoughts or assistance.
Thanks!
Chromium writes exit status into Preferences file. When it starts it writes Preferences file with:
"exited_cleanly": false
and upon clean exit writes Preferences file with:
"exited_cleanly": true
To prevent message about unclean shut down make sure that you have "exited_cleanly": true written in your Preferences file
On my Linux kiosk running on Raspberry Pi this sed command line added to /etc/rc.local fixes issue permanently:
sed -i 's/exited_cleanly\":\ false/exited_cleanly\":\ true/g' /home/pi/.config/chromium/Default/Preferences

Open google chrome (all users installation) in kiosk mode from terminal

I execute this in order to open Google chrome in kiosk mode:
"C:\Users\Javier\AppData\Local\Google\Chrome\Application\chrome.exe" --user-data-dir=$(mktemp -d) --kiosk "url"
but, what I need to modify if google chrome is installed in Program Files(x86)? If I execute:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=$(mktemp -d) --kiosk "url"
I get an error in --user-data-dir=$(mktemp -d) sentence.
Thanks in advance.
Javier
I think there may be no elegant solution at this point. "mktemp -d" is a linux/unix command and I can't find it, or an equivalent, on windows. It may have worked at one time (I stumbled on mktemp on a microsoft development page), but on 8.1 it didn't. The error I was getting said it had to do with permissions, but that wasn't the case.
If someone could get commands in Cygwin working at the windows command prompt then maybe the above would work. Another option may be to create something for PowerShell that does the same and plug that in there.
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=c:\somedir --kiosk "some.url.here" does work though. It works from a shortcut, so it should also work from the command line, but you do lose the random temp directory.
For my case, I just wanted some websites/web-apps to default full screen (F11) from a shortcut and I'd just Alt-F4 to close, and Alt-Tab between them and the desktop. As it is, I'm thinking I'll have to make a separate data-dir for each one I want to do.
I was using the command chrome.exe --user-data-dir=$(mktemp -d) --kiosk http://someUrl/ and it was working well for over a week until I started testing my program with a limited privilege user today. I noticed that chrome process itself did not start after calling process.start() method. There were no entries in event logs to see what went wrong. After looking at your solution, I changed my program to generate a temp folder using C# command pass it as an argument and it started working. Thanks for the help. This is the simplified version of the code I use.
DirectoryInfo tempDirectory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "Chrome" + DateTime.Now.ToString("ddMMHHmmss")));
Process process = new Process();
process.StartInfo.FileName = GetBrowserPathFromRegistry();
process.StartInfo.Arguments = String.Format("--user-data-dir={0} --kiosk {1}", tempDirectory.FullName, this.uri);
process.Start();

Loadrunner 11.52 record chrome with command line switches

I have side by side chrome installs for testing:
version 35
version 13
To launch version 13 I have a separate chrome application directory and pass in some command line switches e.g.:
--user-data-dir="C:\UserData" --chrome-version=13.0.782.218
This works fine, on the desktop I just create a shortcut to the exe and tag on the switches.
How do I do that when I record in Loadrunner?
I can browse to the exe from the "start recording" dialog, but I can't add the switches.
Using the desktop shortcut with the switches doesn't work.
Any ideas?
If your website does not generate chrome specific code then just use any browser for recording
You can always record in proxy mode any HTTP based communication you wish, whether on machine or not.