so i try to run off my PC, with Google chrome still running, this causes the next time i turn on my pc and open chrome, it ask to restore session. how to prevent this or how to make it always auto restore session? either works fine
When you shut down or log out of GNOME while Chrome is still running, Chrome is not always given enough time to exit cleanly. As a result, on the next launch it assumes the previous session ended unexpectedly and shows the “Restore session” prompt.
This is a known behavior with Chromium-based browsers on GNOME. The session manager may terminate applications before they finish writing their state, so Chrome interprets it as a crash rather than a normal exit.
There are basically two ways to deal with it:
1. Prevent the restore prompt (clean shutdown)
Close Chrome manually before shutting down, or ensure it receives a proper SIGTERM and has time to exit.
2. Always restore automatically
In Chrome settings, enable:
On startup Continue where you left off This bypasses the prompt and restores tabs automatically.
If you want a more system-level fix, some users work around this by running a pre-shutdown script that gracefully terminates Chrome (e.g., sending SIGTERM and waiting), but that depends on your distro and session setup.
hi
thx for the reply
the 1st is already the behaviour i can’t do because i have multiple window of chrome that manually killing them will not have that specific of window being restored as it’s considered “closed” when i starrt again
the 2nd option: that “on startup continue where you left off” doesn’t work when the chrome is not gracefully shut down before.
i have tried created some shutdown script and it seems bypassed as well/unreliable. can give me some insight? thx
I see the issue now, It sends a SIGTERM, but doesn’t give Chrome’s database enough time to flush its state to the disk before the session is killed. This leaves the Preferences file with an exit_type: Crashed flag, which triggers the prompt regardless of your settings.
Since your workflow involves multiple windows and manual scripts have been unreliable, here are two robust ways to bypass this:
Method 1: Use the Chrome Policy Engine (The “Cleanest” Way)
Instead of a script, you can tell Chrome’s internal engine to never show that bubble.
1. Run:
sudo mkdir -p /etc/opt/chrome/policies/managed/
2. Create a file:
sudo nano /etc/opt/chrome/policies/managed/suppress_restore.json
3. Paste this:
{
"HideRestoreDialogEnabled": true
}
This forces the UI to skip the prompt, but since you have “Continue where you left off” enabled, it will still restore your windows silently.
Method 2: Launch with specific flags
Modify your Chrome shortcut (google-chrome.desktop)
and add this flag to the Exec line:
--disable-session-crashed-bubble
Method 3: The “Sed” Startup Fix
If you want to ensure the session is always considered “Normal,” you can create a small wrapper script to launch Chrome that cleans the config file first:
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' ~/.config/google-chrome/Default/Preferences
google-chrome-stable
Option 1 is usually the most stable because it doesn’t rely on timing or scripts; it changes how Chrome behaves at the core level.