34

Is there a way to permanently disable the Google Chrome session restore (see screenshot)?

It appears at almost every system start. Not everytime, which makes it difficult to reproduce. Also, I could not notice any relation to whether there was a previous crash or not.

enter image description here

EDIT 1:

Version in use: Google Chrome 68.0.3440.75

Socrates
  • 537
  • 1
  • 5
  • 9

4 Answers4

14

Edit the file located at C:\Users\username\AppData\Local\Google\Chrome\User Data\Default

Right click "Preference" file and click edit. ctrl+f to find the following values, and change the value to:

"exit_type": "none",

"exited_cleanly":true,

Save the file, and change the attribute to "read only" so chrome can't change it back.

Thomas B.
  • 364
  • 2
  • 10
  • 4
    Running `perl -pi -e 's/exit_type\":\"Crashed/exit_type\":\"none/' ~/.config/google-chrome/Default/Preferences` does the trick for me on Ubuntu. Executing this whenever your graphical environment starts gets rid of the Chrome warning for good, without having to change the file to readonly. (Someone could make this an answer, I am lacking the rep …) – panepeter May 08 '19 at 07:46
  • 1
    Thanks this seems to work more than one year later. – Snak3d0c Jun 20 '19 at 07:34
  • @panepeter would this then disable the Restore functionality? What I want is for Chrome to restart on its own to where I was. What I don't want it is to ask me if I want to restore - why did I think it crashed in the first place? It doesn't do that in Windows/Mac. – Zlatko Sep 08 '19 at 13:05
  • 1
    @Zlatko sorry I'm never using the restore functionality, I expect my chrome to start with a blank tab and no annoying warning, and this solution does that exactly. Why not give it a try and see if it works for your setup? Nothing to lose here … – panepeter Sep 08 '19 at 13:48
  • Well I frequently do have several tabs open where I want them and starting blank would alter my workflow. I'll see how I can adjust, thanks for the help. – Zlatko Sep 09 '19 at 14:04
  • panepeter I sugest using "Normal" instead of "none". I tested and "none" impedes from opening my 3 initial tabs. "none" force chrome to load one unique blank tab. As I use 3 different websites, the better option is "exit_type":"Normal" instead of "exit_type":"none" – Sergio Abreu Apr 12 '20 at 20:52
  • @panepeter just to confirm this programmatic editing of the Preferences file has to be done at every startup? it's a shame that there is a zillion command line flags and none of them seem to address this issue. https://peter.sh/experiments/chromium-command-line-switches/ In my case I launch chromium on a specific site (kiosk) and I was every boot to be repeatable no garbage popups even the user hard powered down the computer, now I need to find were they stash all users Preferences – Meryan May 29 '20 at 23:33
  • I tested this on Ubuntu 18.04 with Chromium 65 and it still works. It's very important to change the Preferences file to read only, or this will not work – franksands Jul 06 '20 at 15:11
6

Chrome has a special flag to disable session restore window. But be aware options in chrome://flags are experimental and you may lose browser data or compromise your security or privacy.

Follow these steps:

  • Open Chrome.
  • Type chrome://flags/#infinite-session-restore in address bar (Crtl+L).
  • Click on the right drop-down menu and change the 'Default' value to 'Disable'. Then restart Chrome to apply that setting.

So what does this do? That option says -- "Reduces the number of tabs being loaded simultaneously during session restore, to improve responsiveness of the foreground tab". After disabling and restating Chrome, it relaunches chrome.exe with --disable-features=InfiniteSessionRestore option.

Biswapriyo
  • 10,831
  • 10
  • 47
  • 78
5

After @Biswarpriyo s Answer don't work anymore (the flag got removed), it is possible to start Chrome (tried it with 86.0.4240) with the --disable-session-crashed-bubble parameter.

For Linux: Just add it after the command in terminal. For example: chrome --disable-session-crashed-bubble

For Windows: You have to create a shortcut to chrome.exe (usually located in C:\Program Files (x86)\Google\Chrome\Application\ ) and add it to the target like described here

Leon D
  • 188
  • 1
  • 7
  • I don't run chrome myself. TOSCA does. So passing options is not as helpful as a flag. If I start Chome myself I could just close the box but in test automation this is not an option. – Martin Mar 25 '22 at 12:58
2

See my answer on how I resolved this for the Chromium on a raspberry pi.

https://superuser.com/a/1643107/690627

Basically

su
(note: super-user remain in current user path, now using relative to local path)
chattr  +i  .config/chromium/Default/Preferences
chattr  +i  .config/chromium/'Local State' 

Meryan
  • 222
  • 2
  • 12