61

Chrome offers to restore the last session when it did not shutdown properly (power outage, Chrome crashed, ...).

How do I disable that? (Setting or command line switch)

I'm using a batch file that starts (among other things) chrome in kiosk mode for a single page on windows startup. Even after power outage etc. it should only launch that page without the ruckus.

6
  • 1
    It 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
    Aug 13, 2012 at 12:40
  • @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
    Aug 13, 2012 at 13:04
  • @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 Aug 13, 2012 at 13:04
  • A power outage prevents clearing history / sessions. Deleting the whole profile folder works, but that feels like a bit too much...
    – riha
    Aug 13, 2012 at 13:30
  • @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
    Jul 23, 2015 at 0:28

6 Answers 6

43

I know this is old but I thought it would be helpful to others that may come across this.

I had this issue and tried the flags settings but that did not help. adding --incognito to the command did resolve the issue.

chrome.exe --kiosk --incognito some.web.site

I tried this in various fashions of crashing Chrome and pulling the power to the PC. In all tests the system would power up and go into kiosk mode without the frown face error message.

4
  • 1
    Is this any different than @Dom's answer? Jul 12, 2013 at 13:39
  • 8
    note, incognito mode disables caching, so if that's important for your application this is not a great option.
    – ericsco
    Oct 24, 2013 at 19:43
  • This disables any extensions you have set up. Jun 27, 2019 at 6:43
  • @AndréChristofferAndersen Not necessary, you can enable extensions in incognito mode.
    – Sos.
    Jan 4, 2022 at 5:03
31

try this line (old)

chrome.exe --kiosk --disable-session-crashed-bubble "http://example.com"

(new)

chrome.exe --kiosk --hide-crash-restore-bubble "http://example.com"

For more detailed information

https://peter.sh/experiments/chromium-command-line-switches/#hide-crash-restore-bubble

5
  • 8
    this works well if you include --disable-infobars which then kills the warning alltogether
    – l0ft13
    May 28, 2015 at 8:35
  • As of now chrome.exe --disable-session-crashed-bubble is just enough to put the prompt away.
    – Deilan
    Apr 25, 2017 at 12:09
  • 16
    note that this does'nt work with Chrome 58 anymore
    – bk138
    May 27, 2017 at 19:36
  • 1
    Yes, --disable-session-crashed-bubble seems to be non-operational, feel free to add your two bits to bugs.chromium.org/p/chromium/issues/detail?id=445256#c17 to let the Chromium team know this matters.
    – B Robster
    May 7, 2018 at 12:31
  • With Chrome 71: --restore-last-session argument when launching chrome
    – Matt
    Jan 7, 2019 at 18:38
28

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)

6
  • If I had used linux back then, I would've probably given this a try.
    – riha
    Feb 17, 2015 at 9:59
  • 1
    This slightly modified command works with Chromium 56: sed -i -e 's/("exit_type":\s*)"Crashed"/\1"None"/g' \ -e 's/("exited_cleanly":\s*)false/\1true/g' \ ~/.config/chromium/Default/Preferences
    – Sundae
    Jan 27, 2017 at 13:15
  • Don't forget about the chromium/Local State file, which has the same field. Apr 11, 2017 at 7:40
  • 1
    I put an updated answer, based on this information, at superuser.com/a/1206120/4160. May 4, 2017 at 20:27
  • 1
    To make it handle either do something like this: sed -i 's/"exit_type": *"Crashed"/"exit_type": "None"/' ~/.config/google-chrome/Default/Preferences That will handle any number of spaces between the key and values (including none).
    – rofer
    Jun 17, 2018 at 16:32
14

Try this

  • go to chrome://flags/
  • then click Enable on the link that writes: "Disable Better session restore"

I hope this helps

1
  • 11
    Looks like they removed this flag... (Windows Chrome v38), bummer.
    – B Robster
    Oct 28, 2014 at 18:22
4

Open chrome \ Default \ Preference, and change the value to

"exit_type": "none",

"exited_cleanly": true,

Save the file, and put him to attribute "read only". Tested on various versions of the Chrome browser

1
  • 3
    On Chrome 72 "exit_type": "Normal" appears to be the preferred value. Feb 28, 2019 at 19:42
3

Someone has suggested just running Chrome in Incognito mode to get around the problem here. If you are running in full screen mode and redirecting to a specific page that shouldn't be noticeable. I know that's a bit of a work around.

3
  • That certainly provides some helpful info, thanks. My current workaround is to delete the whole profile folder before starting chrome. Incognito is probably the better choice. I'll report back.
    – riha
    Aug 15, 2012 at 5:39
  • 1
    note, incognito mode disables caching, so if that's important for your application this is not a great option.
    – ericsco
    Oct 24, 2013 at 19:44
  • Yes choosing incognito results in a different popup annoyance because it will prompt to allow target/desired site to store some data over and over and over.
    – Meryan
    May 12, 2021 at 2:58

Not the answer you're looking for? Browse other questions tagged .