Jun 18

Restoring lost Chrome Tabs

For some reason today my Mac decided it didn’t want to work any more and essentially froze up. It was getting slower over the morning and eventually ground to a halt. I think I might have been able to wait it out and kill some stuff but I ended up hard resetting it. When the machine came back most everything recovered…except for Google Chrome’s tabs.

Google Chrome had opened and left me with a blank window without the normal “It looks like Chrome crashed, do you want to restore the tabs?” button. I have the “Continue where you left off” setting so I’m not sure why that didn’t kick in either. Restoring the tabs restored tabs from one window out of the 10 or so windows I had but also interspersed some tabs I’d closed prior to the crash. A quick Google search for “restore closed tabs after quitting Chrome” gave me a lifehacker article which covered the process. It had some notes on prevention but it had a “Recovery Mode” section which mentioned editing the “Local State” file and changing the “exited_cleanly” entry to be “false”.

The article covers four files in the User Data Directory that are relevant to session and tab restore: Current Session, Current Tabs, Last Session and Last Tabs. The suggestion in “Recovery Mode” is to restore these files. Given I’d lost this data, I wasn’t sure what else had gone so I decided to stop Chrome, rename the “Default” user data directory and then restore the one from an hour ago back in place. Once the restore was done, I edited the “Local State” file as mentioned above and started Chrome. Chrome started and showed the “Chrome didn’t shut down correctly” bar and gave me the option to restore my tabs.

To put this in bullet form, the steps to fix this:

  • Stop Chrome.
  • Go to ~/Library/Application Support/Google/Chrome/ and rename “Default” to something else. (TIP: You can use SHIFT + APPLE + G in Finder you can paste the path to go straight to that folder).
  • Connect to Time Machine.
  • Restore the “Default” folder from the Time Machine backup into ~/Library/Application Support/Google/Chrome/ again.
  • Start up Google Chrome and click on “Restore” in the bar where it says “Chrome didn’t shut down correctly”.
  • All of your windows and tabs should be restored!

This process is very similar to the one for restoring lost Safari tabs. The important piece in both of these cases is to have regular routine backups. Time Machine on Mac OS X provides hourly backups automatically which is invaluable when these sorts of issues occur. Any routine backup solution will work properly (e.g. CrashPlan), you’ll need to adjust the steps to be appropriate for your platform.

 

Edit: It looks like the Local State file is gone and you may not need to set it anyway according to ssorgs’s comment on this post. If your tabs aren’t automatically restored when you restart, try using SHIFT + APPLE + T to reopen recently closed tabs and that should bring them back.

6 comments

6 Comments so far

  1. Rob August 17th, 2016 11:39 pm

    I restored the folder but cannot find the “local state” file so that I can change it? It is not in either Default folder

  2. pasamio August 31st, 2016 3:07 am

    I just looked and it seems that the “Local State” file is indeed missing on my deploy of Chrome as well. Looks like it went missing sometime early in August. Let me dig some more and see if I can find another solution.

  3. ssorgs January 5th, 2017 4:22 am

    Thanks, just what I spent an hour or so searching for!

    I couldn’t find “Local State” file BUT it worked by simply restoring the “Default” folder and reopening Chrome — then it prompted me to reopen closed tabs!!!

    My problem was that Chrome crashed overnight but before I reopened I had clicked a link from Twitter that opened Chrome and bypassed reopen closed tabs.

  4. pasamio January 5th, 2017 4:26 am

    Good to hear restoring the entire folder did it for you. I’ll update the post this evening to make that comment.

  5. Robin January 13th, 2018 2:55 pm

    For some reason this is not working for me. I don’t understand why this would work with one person’s computer but not another. I’m running OS 10.12.6 and Chrome Version 63.0.3239.132.
    With regards to the Local State file, do I just open the file in text edit and replace “true” after “exited cleanly” with “false”? My computer ran out of battery power when there were about 30 important tabs open.
    Feel free to contact me by email because I really need to recover those tabs.

  6. Jason October 30th, 2018 11:00 am

    You RULE!!!!!! This worked, even for an idiot like me. I was desperate to restore my lost tabs and I read that it was something Chrome had decided that Time Machine wouldn’t back up and that I was screwed. Wrong! I got my 70+ tabs back and I can’t thank you enough.

Leave a comment

%d bloggers like this: