When Chrome has crashed, it displays a warning (under the address bar) upon restart, offering to restore tabs. I'm launching chrome in kiosk mode and I don't want theses warnings to be displayed.
Is there a way to do this ?
You should run Chrome in Incognito Mode with this command:
chrome --incognito --kiosk http://127.0.0.1
Here they talk about running this command before starting Chrome to stop the Restore Bar from appearing:
sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' \ ~/.config/google-chrome/Default/Preferences
There are a few approaches.
Incognito mode (
--incognito) helps, but it has several disadvantages, such as disabling the cache.
--disable-infobars --disable-session-crashed-bubble works in some versions of Chrome, but, as of Chrome 58, it no longer works. (Removing the
--disable-session-crashed-bubble was done as part of this issue; comments there suggest that the flag was intended to test the bubble feature and was not intended as an end-user feature to hide the Chrome warning).
The most reliable approach I've found is to manually edit Chrome's on-disk preferences. Here's how you do this on Linux. (Note that these instructions are for chromium-browser; Google Chrome itself uses
~/.config/google-chrome instead of
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State' sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
Putting it all together with a couple of additional flags that have been helpful for kiosk mode in one Chrome version or another:
#!/bin/sh sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State' sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences chromium-browser --kiosk --no-default-browser-check --no-first-run --disable-infobars --disable-session-crashed-bubble "http://some_url/"
while true; do chromium-browser --kiosk http://fotolia.com/ --no-first-run --touch-events=enabled --fast --fast-start --disable-popup-blocking --disable-infobars --disable-session-crashed-bubble --disable-tab-switcher --disable-translate --enable-low-res-tiling sleep 10s; done
This finally worked for me, and it's pretty simple:
That will lock the state of two variables, regardless of how Chromium was shut down:
Of course, only do that after you're done setting preferences
--restore-last-session will also do the job.
I have been trying to solve this problem for days. Incognito mode comes without cache, and changing Preferences file did not work for me.
Finally I have been able to solve by following steps below:
chrome://flagsurl. Search for “Enable session restore bubble UI” and set it to Disabled.
--restore-last-session argument when launching Chrome.