I am running Chromium 39 on Ubuntu 14.04, on a single-board computer (ODROID U3, though I believe the question is applicable to Chromium on any Ubuntu system and possibly other Linux distros as well).

The computer is being used with Chromium in kiosk mode to power a large wall display; however, if the system loses power, when Chromium restarts it has the big nag bar complaining that "Chromium didn't shut down correctly". Since the system is designed to be automated, and we intend to run multiple systems, manually remoting into the machine (or worse, running around connecting and disconnecting a USB mouse) is not an acceptable solution.

How can I prevent Chromium from popping up this warning if it gets shut down improperly?

share|improve this question
up vote 10 down vote accepted

Much easier solution, start Chromium with the --disable-infobars flag. I tried all of the above before finding it, and it does exactly what I wanted. You can leave all of the other stuff alone.

My specific command line is:

/usr/bin/chromium-browser --start-fullscreen --disable-session-crashed-bubble --disable-infobars http://www.example.com
share|improve this answer
    
Thanks for posting this. Works great with the --kiosk switch. – Dan McDougall Jan 5 '16 at 14:34
    
I don't think --start-fullscreen is needed when using --kiosk. – emc Feb 2 '17 at 4:00

Also, apparently running in incognito mode by default will also prevent the error because nothing is saved from the session against which to check for a crash.

example: chromium-browser --kiosk --start-maximized --incognito kiosk.html

share|improve this answer
    
--incognito does work, but it kills cookies, which (in my case) are required – Davide Andrea Sep 30 '17 at 22:52

Solution/Hack in 5 seconds (https://askubuntu.com/a/720855) Settings->Advanced Settings->System-> uncheck Continue running background apps when Chrome is closed

(read the whole thread for hints on why the issue happens. Makes a lot of sense)

share|improve this answer
2  
Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill May 5 '16 at 10:45
    
Thank you . This is a much simpler solution and worked for my case. – Plazgoth Nov 23 '16 at 19:30

Chromium version 39 (on Ubuntu at least) tracks the browser's exit state in three separate files:

  • ~/.config/chromium/"Profile 1"/Preferences
  • ~/.config/chromium/"Profile 1"/.org.chromium.Chromium.XXXXXX
  • ~/.config/chromium/"Local State"

Where "XXXXXX" is a six-digit random alphanumeric string. Note also that "Profile 1" may be named differently based on what browser profile you are using (another common profile name is simply "Default")

The two profile-based files have two entries that can trigger the message, "exit_state" (values are either "Normal" or "Crashed", with quotes) and "exited_cleanly" (values are either true or false, without quotes).

The "Local State" file only contains the "exited_cleanly" entry.

There is also a "lock" file that may cause trouble; this file is located at

  • ~/.config/chromium/SingletonLock

You can write a script that uses sed and rm to correct these before launching Chromium

#!/bin/bash

#Set CrProfile to the value of your startup profile's config folder
CrProfile="Profile 1"

#Set URL to the URL that you want the browser to start with
URL="http://www.example.com"

#Clean up the randomly-named file(s)
for i in $HOME/.config/chromium/$CrProfile/.org.chromium.Chromium.*; do
    sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' $i
    sed -i 's/"exit_state": "Crashed"/"exit_state": "Normal"/' $i
done

#Clean up Preferences
sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' $HOME/.config/chromium/$CrProfile/Preferences
sed -i 's/"exit_state": "Crashed"/"exit_state": "Normal"/' $HOME/.config/chromium/$CrProfile/Preferences

#Clean up Local State
sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' $HOME/.config/chromium/"Local State"

#Delete SingletonLock
rm -f $HOME/.config/chromium/SingletonLock

/usr/bin/X11/chromium-browser --kiosk $URL

Note that for ideal usage, Chromium's preferences should be set to start with a new tab, rather than a specific URL or restoring a session; this will ensure that it starts with the specified URL and nothing else.

share|improve this answer
    
Please note that I rewrote the script from memory (with the help of notes reminding me where the files were located); if anyone spots any glaring syntax errors or the like please feel free to edit or point it out in comments. – Doktor J Feb 4 '15 at 3:35
    
I don't appear to have the randomly-named files, but otherwise this helped me. – Roger Lipscombe Apr 9 '15 at 16:29
    
This doesn't seem to work any more; I'm still (occasionally) getting the "Restore pages?" warning. Any ideas? – Roger Lipscombe Aug 17 '15 at 10:27
    
@RogerLipscombe if you're still having this problem, see Steve's answer above (which I've marked as accepted because it seems to do the trick on my test unit). Hope it helps! – Doktor J Feb 23 '17 at 18:36

This finally worked for me, and it's pretty simple:

  1. Shut down Chromium gracefully
  2. Change the "Change content" permissions of ~/.config/chromium/Default/Preferences to "Nobody"

That will lock the state of two variables, regardless of how Chromium was shut down:

  • "exit_type": "Normal"
  • "exited_cleanly": true

Of course, only do that after you're done setting preferences

share|improve this answer
    
Thanks for catching that. I had posted it in the wrong place. I cut it from there, copied here. Fixed. – Davide Andrea Oct 2 '17 at 0:28
    
Yes, I wrote it. I wrote in the wrong browser tab (different question). When I noticed, I cut it from there (so the original no longer exists) and I pasted it in the tab with this question, the correct place. I am really sorry for having caused all this confusion, and I thank you for catching my pasting mistake. – Davide Andrea Oct 2 '17 at 0:39
    
OK, then, you're fine. – Scott Oct 2 '17 at 0:41
1  
Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places. – DavidPostill Oct 2 '17 at 5:01
    
Yes, thank you. – Davide Andrea Oct 2 '17 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.