I see some inconveniences in the solutions provided:
--incognito switch removes cache, what is pretty bad in most circumstances.
(Copy-pasting chrome help )
Google Chrome has hundreds of undocumented command-line flags that are added and removed at the whim of the developers.
--disable-session-crashed-bubble depends of which version of chrome are you using, the most actual version v39 doesn't have this setting allowed.
The solution I did was to alter the user profile and overwrite the crash status to a normal close status, It's a simple hack that works perfect.
This is the script I run in kiosk-mode in a chrome-only session under Ubuntu 12.04 and 14.04
#!/bin/sh
sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/google-chrome/Default/Preferences
sed -i 's/"exit_type": "Crashed"/"exit_type": "None"/' ~/.config/google-chrome/Default/Preferences
google-chrome --kiosk "http://some_url"
It simply finds and replace the string
- "exited_cleanly":false
- exit_type": "Crashed"
with
- "exited_cleanly": true
- "exit_type": "None"
So, no matter how chrome has closed. It will always think it has closed gracefully.
(Tested in many chrome versions)
@janot and other closevoters: this question is more highly upvoted and has a lot more views than the linked duplicate. I've voted to close the older, less-viewed one as a duplicate. – nc4pk – 2015-07-23T00:28:48.377
@ncdownpat I guess thats because most people search for "chrome disable session restore", not "chrome crash warning" or the like. At least that's why I created a new question back then - I didn't find the other one. Anyhow, my first gold badge =) – riha – 2015-08-07T11:45:21.047
1It might not be possible to disable it. If you are using a batch file, I would simple delete the file that handles the session, before you launch Chrome. – Ramhound – 2012-08-13T12:40:36.290
@Ramhound Which file(s) would that be? "User Data\Default\Current Session" and "User Data\Default\Current Session" don't seem to make a difference. Neither does "User Data\chrome_shutdown_ms.txt". – riha – 2012-08-13T13:04:25.353
@riha simply clearing history and sessions before closing the browser will solve your problem and there were some third party tools which would automatically wipe history when your system is restarted – BlueBerry - Vignesh4303 – 2012-08-13T13:04:54.467
A power outage prevents clearing history / sessions. Deleting the whole profile folder works, but that feels like a bit too much... – riha – 2012-08-13T13:30:47.213