greatsuspender / thegreatsuspender

A chrome extension for suspending all tabs to free up memory
https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg/
GNU General Public License v2.0
5.03k stars 905 forks source link

Recovering lost tabs after extension update or removal #526

Open deanoemcke opened 7 years ago

deanoemcke commented 7 years ago

This is the official issue for users trying to recover from tab loss due to an update of the extension, or following removal/disabling of the extension. This is the number one pain point of the extension and here I will attempt to address why this is an issue, and what you can do if affected by it.

Overview: Why do my tabs disappear when the extension updates or is removed? What is the safe way to remove the extension? What is the safe way to update the extension What should I do if I have lost tabs? How to recover lost tabs with The Great Suspender How to recover lost tabs without The Great Suspender My suspended tab says "This site cannot be reached"


Why do my tabs disappear when the extension updates or is removed?

The Great Suspender works by redirecting a tab to a new url in order to 'suspend' it. This means that the tab is now controlled by the extension process. When the extension updates or is disabled or uninstalled, this process is killed and all tabs that belong to it are removed from the browser. For this reason, I try to keep the number of updates to the extension to a minimum.

The extension does come with an inbuilt tab recovery system that will automatically detect and reload lost tabs in aftermath of an update or extension crash. And in the event of an update, a session restore point is automatically created in the Session History page and can be restored manually.

What is the safe way to remove the extension?

If you want to uninstall the extension, please unsuspend all tabs before doing so. This is the only way to prevent those tabs from disappearing. This can be done easily by clicking the 'Unsuspend all tabs' option in the extension popup menu. Or more manually by visiting every suspended tab and manually reloading it. Please note that if using the 'Unsuspend all tabs' option, you will need to do this once for each chrome window you have open.

If you failed to unsuspend all tabs before uninstalling and have lost tabs, please refer to the section below entitled "How to recover lost tabs without The Great Suspender".

Please note, uninstalling the extension will also permanently remove all extension data including tab history and extension options. Reinstalling the extension will not enable you to do any sort of recovery.

I would recommend anyone wanting to remove the extension to first back up their tabs using another extension called "Session buddy". This tool will allow you to back up all your tabs and restore them again at a later date. Please be aware that those tabs suspended at the time the session buddy backup is performed will not have their correct urls. These links will only work as long as The Great Suspender is currently installed on your browser. If you want the real urls in your session buddy backup, then you will need to unsuspend all your tabs first.

What is the safe way to update the extension?

Unfortunately chrome does not give the user the ability to manage their own extension updates. As soon as a new release is made available on the webstore, this update is automatically pushed to users.

I have done my best to mitigate the potential for lost tabs during an update by prompting users to export a backup of their tabs before accepting the new update.

As mentioned above, a session restore point will also automatically be created to save a record of your open tabs before the update. You can then recover any lost tabs via this restore point from the Session History screen accessible from the extension Options page.

What should I do if I have lost tabs?

If you have lost tabs due to the extension being removed then refer to the section below entitled "How to recover lost tabs without The Great Suspender".

If you have lost tabs due to the extension being disabled, then first re-enable the extension, and then refer to the section below entitled "How to recover lost tabs with The Great Suspender".

If you have lost tabs but the extension still seems to be installed and running, then refer to the section below entitled "How to recover lost tabs with The Great Suspender".

Before continuing, it's worth checking first that you have not simply switched chrome profiles. If you have multiple chrome profiles, then each one will have a separate record of tab history.

How to recover lost tabs with The Great Suspender

The extension comes with its own tab history management UI to help users recover from lost tabs. Go to the extension options page (from 'settings' in the popup or 'options' when right-clicking on the extension). Then in the settings sidebar click on 'Session management'. This will show you your most recent tab sessions. You can click on each session to see more detail on the individual windows and tabs it contains.

To reload a session, simply click the 'reload' link. This will reload all windows and tabs in an 'unsuspended' state. If your session contains a very large number of tabs, then you might instead want to click 'resuspend' which will be much faster as it reloads the tabs in a suspended state.

If for some reason the missing tabs are not in your recent sessions, then please follow the guide below for recovering lost tabs without using The Great Suspender.

If you have access to system backups, you may be able to restore old 'recent sessions' from these backups. The recent sessions are stored in an IndexedDB database at Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob/ and Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.leveldb/

How to recover lost tabs without The Great Suspender

You can attempt to recover lost tabs by using chromes in-built history page. Navigate to chrome://history in a new tab and you will be shown a list of tabs you have visited in the past grouped by date and showing the most recent at the top. Somewhere in this list you will have a record of all the tabs you lost. However it can be a bit tricky to find them as they are mixed in with all the tabs you have visited and purposely closed as well.

For example, if you opened a tab one week ago, and it got suspended and you never revisited that tab, then in chrome history, it will be grouped with all the tabs from one week ago.

You can try searching for "klbibkeccnjlkjkiokjodocebajanakg" to find tabs that were suspended. This may help narrow down the list.

If you do find a lost tab in this list, there is a chance that when you try to reopen it, it will take you to a blank page saying "This site cannot be reached". Please refer to the section below on how to recover these tabs.

My suspended tab says "This site cannot be reached"

It can happen that when you open a suspended tab link, or try to unsuspend a tab, you will see a blank page with the text "This site cannot be reached". And it will have a strange url that looks something like this: chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/suspended.html#ttl=Google&uri=https://www.google.com.

This is most likely due to the fact that you no longer have The Great Suspender installed in your browser. The easiest way to recover these tabs is to reinstall the extension, and then reload the page.

Should this fail for any reason (which would happen if you tried to open this url in another browser like firefox, or from a device that does not support extensions such as an android phone), then as a last resort you can manually edit the url to recover the tab. Delete everything before the &uri= text in the address bar and the page should reload corrently. ie: in the example above you would end up with https://www.google.com.

a5m0 commented 5 years ago

I notice on my windows machine the session management page has lots of sessions listed, my linux machine is all blank and is the one that lost sessions.

RezaRob commented 5 years ago

The Great Suspender: v7.1.0

A lot of tabs just got closed!

Session Management shows absolutely nothing! All the tabs seem to be permanently gone.

I also need to disable automatic updates and there is apparently no way to do that.

I would have to necessarily stop using this extension if it is responsible for the problem.

deanoemcke commented 5 years ago

It sounds like linux could be a common thread here? I'll do some investigation. And very sorry for all of you who are suffering from lost tabs :(

dskrepps commented 5 years ago

I'm on Windows 8 and also have no sessions. It's even a few days later and I look to see no sessions are saving.

RezaRob commented 5 years ago

I'm on Windows 8 and also have no sessions. It's even a few days later and I look to see no sessions are saving.

Actually, I was just going to come and comment that it's strange: Chrome programming should be independent of the underlying OS, no?! Why would it behave differently on Linux?

deanoemcke commented 5 years ago

@RezaRob I agree. But you do find small differences between the chromium implementations on different operating systems. It's probably grasping at straws though.

@dskrepps Would you mind doing a little bit of debugging for me? That is probably the fastest way to get to the bottom of this. The wiki has instructions on how to enable the debugging log: https://github.com/deanoemcke/thegreatsuspender/wiki/How-to-enable-the-debugging-log

Once that's turned on, you just need to open and close a tab or two. Normally this would cause the current session to get saved. I suspect that is generating an error which will hopefully be logged to the console.

deanoemcke commented 5 years ago

Is there anyone else on this thread that is having the issue of no current and recent sessions being recorded in the session management view? If so, would anyone like to help with debugging it to see what is going on?

The wiki has instructions on how to enable the debugging log: https://github.com/deanoemcke/thegreatsuspender/wiki/How-to-enable-the-debugging-log

Once that's turned on, you just need to open and close a tab or two. Normally this would cause the current session to get saved. I suspect that is generating an error which will hopefully be logged to the console.

dskrepps commented 5 years ago

Debug log attached.

klbibkeccnjlkjkiokjodocebajanakg-1553083818550.log

RezaRob commented 5 years ago

I don't see "About" on the left had side of my extensions settings page. See image. sss

On a different note, it appears like Chrome has gotten much better at handling this sort of memory overload problem at startup. It seems like some form of lazy-load is already being implemented and it's cleaner than before. So, I'm not entirely sure I will need this extension.

dskrepps commented 5 years ago

@RezaRob You're looking at Chrome's extensions settings page, you want to look at The Great Suspender's own settings page: tgssettings

RezaRob commented 5 years ago

Debug log attached: klbibkeccnjlkjkiokjodocebajanakg-1553179795481.log

deanoemcke commented 5 years ago

@RezaRob @dskrepps Thanks heaps for this. That's super useful. But still not enough to get to the bottom of it. Can you try pasting this into your DevTools console, press enter, and then report back with everything it says?

let gsDb = await gsIndexedDb.getDb();
let results = await gsDb
  .query(gsIndexedDb.DB_CURRENT_SESSIONS)
  .all()
  .desc()
  .execute();

Also, within DevTools, can you go to the Application tab at the top, then expand IndexedDB on the sidebar. You should see tgs - chrome-extension://... and if you expand that, then gsCurrentSessions. Once you click on this, it should show you a list with one entry which is your current session. Do you have this entry?

Thanks for your help.

Also, @RezaRob, I'm aware of the improvements that chrome has made on startup. It actually starts up better with no suspended tabs than if you do have them (as I need to do extra work to make sure the suspended tabs get the correct favicons - due to the new lazy loading :/ ). BUT, this doesn't solve the problem of chrome using up a lot of ram once you have opened many tabs. It's only good so long as you dont visit all of those tabs that got restored.

I agree though, it's one less use-case for this extension. Which is actually a good thing. Hopefully one day this extension will not be useful at all :D

RezaRob commented 5 years ago

@deanoemcke, I really appreciate what you're trying to do. This extension has been a lifesaver for me for a long time, and I'm really grateful for that. I owe you for that.

Regarding excess memory after use, Chrome Task Manager let's you stop high memory consuming processes fairly easily. Then, to restart them, pressing the backward/forward navigation buttons (NOT the reload button!) on the stopped page will do a reload, and gets you back to the same page position that you were reading before. I have a feeling that'll be enough for me.

Moreover, a matter of principle bothers me: even last time that I gave you the bug report, I lost several pages. I don't want to run an extension which could easily threaten my browser/work state upon an automatic update which is completely out of my control. This should be fully tested before I have to do the debugging on my end. One option would be a virtual "linux" machine to do the test. In any case, like I said, a Chrome extension should be platform independent, and I still don't understand why it wouldn't be.

Years ago, I had this discussion with the Chromium Dev folks (I think) on their forums, and I begged them to put these features into the official release because I knew problems like this would arise. Now Chrome has gotten better with these memory/startup issues apparently, but perhaps it still needs some more memory management features (after startup.)

We already have a Session Manager extension which appears fairly simple and light weight, and seems to work well. I'm not sure where it stores the session info, but something like this, I suppose, shouldn't be too difficult to do: https://chrome.google.com/webstore/detail/session-manager/bbcnbpafconjjigibnhbfmmgdbbkcjfi

pluto00987 commented 5 years ago

What is the safe way to remove the extension?

If you want to uninstall the extension, please unsuspend all tabs before doing so. This is the only way to prevent those tabs from disappearing. This can be done easily by clicking the 'Unsuspend all tabs' option in the extension popup menu. Or more manually by visiting every suspended tab and manually reloading it. Please note that if using the 'Unsuspend all tabs' option, you will need to do this once for each chrome window you have open.

FWIW I was able to set and use the extension's 'Unsuspend all tabs in all windows' hotkey to accomplish this. It was MUCH easier than manually going to each window and doing it. I was on version 6.30.

TheKnarf commented 5 years ago

I just lost all of my suspended tabs (some from months ago) and can't seem to get any of them back. The extension suddenly got disabled and Chrome said that it needed new right or something? Session management doesn't show anything and now I'm a bit lost..

If you have access to system backups, you may be able to restore old 'recent sessions' from these backups. The recent sessions are stored in an IndexedDB database at Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob/ and Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.leveldb/

I found the folders and took a copy of them, but what do I do with them @deanoemcke ?

The blob directory seems to just be a bunch of empty files.

There seems to be a logfile in the leveldb folder called 019280.log. Running strings 019280.log on it reveals I what I assume to be a log of all tabs ever suspended, but thats around ~4500 items, it doesnt seem to be any easy way of finding the set of tabs that I lost?

Running strings 019280.log>tmpfile and then opening it in Vim (vim tmpfile) and starting at the bottom I'm able to manually recover the tabs I've that only got suspended a few days ago. But the ones who've been there longer I imagine will either take me a long time or I'll have to give up.

slfn-ldkf commented 5 years ago

Just lost all of my suspended tabs, because this updated without asking. Session management is empty, they don't show as closed in my Chrome history. This is completely ridiculous and I'm removing this extension immediately, after using it for years. I'm so angry, this seems like basic usability. Screen Shot 2019-08-24 at 11 09 09 pm

hamakei commented 5 years ago

Had the exact same problem. Extension trashed over a hundred tabs with no warning. Thanks for nothing.

jvschiavo commented 5 years ago

Just lost all of my suspended tabs, because this updated without asking.

@slfn-ldkf There is no way for a Chrome extension to ask before updating. Couldn't you get them back with the session "How to recover lost tabs without The Great Suspender"?

hamakei commented 5 years ago

Nope. There is no previous session. It's completely blank.

slfn-ldkf commented 5 years ago

@jvschiavo Did you see the screenshot I posted? There was nothing there. I had Chrome open but was in conversation and not looking at it. When I looked back, I had a tab saying this had updated, my pinned and active tabs were still open, and everything else was gone. Obviously the first thing I did was check my history and follow the steps suggested. Nope. The tabs only show as closed when they were last suspended, which for some of these will be months back. Really not good enough.

Kovaelin commented 5 years ago

I just lost all of my suspended tabs (some from months ago) and can't seem to get any of them back. The extension suddenly got disabled and Chrome said that it needed new right or something? Session management doesn't show anything and now I'm a bit lost..

If you have access to system backups, you may be able to restore old 'recent sessions' from these backups. The recent sessions are stored in an IndexedDB database at Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob/ and Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.leveldb/

I found the folders and took a copy of them, but what do I do with them @deanoemcke ?

The blob directory seems to just be a bunch of empty files.

There seems to be a logfile in the leveldb folder called 019280.log. Running strings 019280.log on it reveals I what I assume to be a log of all tabs ever suspended, but thats around ~4500 items, it doesnt seem to be any easy way of finding the set of tabs that I lost?

Running strings 019280.log>tmpfile and then opening it in Vim (vim tmpfile) and starting at the bottom I'm able to manually recover the tabs I've that only got suspended a few days ago. But the ones who've been there longer I imagine will either take me a long time or I'll have to give up.

I'm just trying to figure this out. I also found a log file. I didn't have a blob directory at all! How did you run strings?

Lubaska commented 4 years ago

It works nicely. Recovered 112 tabs a few minutes ago. Thank you.

snowman commented 3 years ago

Hmmm. That's annoying, today I'm going to clean my extensions, and try it and notice this extension is not what I needed, then uninstall it and now I lost my 20 tabs.

AmbivalentLife commented 3 years ago

Created a Github account just to say that this was an UTTER lifesaver and saved dozens of tabs that I assumed were lost. Thank you so much!

dm17 commented 3 years ago

Evil. 500 tabs lost. Somehow they were taken away from session buddy ability to auto save as it does? I'm just about ready to write my own; I've lost tabs under so many browsers and plugins. This is BABY LEVEL DEVELOPMENT. How is this still a common occurrence after so many years? It is called USER DATA - fools!

dm17 commented 3 years ago

"chrome://history" - not true! If you haven't restarted your browser for weeks, then there is no way you'll get those tabs back without many hours of work - days if there are hundreds of tabs.

dm17 commented 3 years ago

"I would recommend anyone wanting to remove the extension to first back up their tabs using another extension called "Session buddy". This tool will allow you to back up all your tabs and restore them again at a later date. Please be aware that those tabs suspended at the time the session buddy backup is performed will not have their correct urls. These links will only work as long as The Great Suspender is currently installed on your browser. If you want the real urls in your session buddy backup, then you will need to unsuspend all your tabs first."

Another bogus recommendation. When The Great Suspender is uninstalled. It deletes all your stuff, including recent stuff from Session Buddy.

tusharvb19 commented 3 years ago

Any way to recover lost tabs? can we temporary enable the extension? image

clach04 commented 3 years ago

@tusharvb19 I just installed the previous version and whilst that is successful, the session data appears to be lost.

HEYimHeroic commented 3 years ago

I just lost all of my suspended tabs (some from months ago) and can't seem to get any of them back. The extension suddenly got disabled and Chrome said that it needed new right or something? Session management doesn't show anything and now I'm a bit lost..

If you have access to system backups, you may be able to restore old 'recent sessions' from these backups. The recent sessions are stored in an IndexedDB database at Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob/ and Chrome/Default/IndexedDB/chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.leveldb/

I found the folders and took a copy of them, but what do I do with them @deanoemcke ? The blob directory seems to just be a bunch of empty files. There seems to be a logfile in the leveldb folder called 019280.log. Running strings 019280.log on it reveals I what I assume to be a log of all tabs ever suspended, but thats around ~4500 items, it doesnt seem to be any easy way of finding the set of tabs that I lost? Running strings 019280.log>tmpfile and then opening it in Vim (vim tmpfile) and starting at the bottom I'm able to manually recover the tabs I've that only got suspended a few days ago. But the ones who've been there longer I imagine will either take me a long time or I'll have to give up.

I'm just trying to figure this out. I also found a log file. I didn't have a blob directory at all! How did you run strings?

unfortunately, it seems my log files were completely blank after the new update. 0 bytes. surely i can do the same process, but for the saved sessions as well?

clach04 commented 3 years ago

Best solution I've seen so far that works (but tedious) is https://github.com/greatsuspender/thegreatsuspender/issues/1263#issuecomment-773538665

dm17 commented 3 years ago

Can we change the name to "the great tab destroyer"?

wchristian commented 3 years ago

@clach04 this is much easier: https://github.com/gioxx/MarvellousSuspender/issues/7

joerobb1 commented 3 years ago

"The Great Destroyer " got me too. Gonna try this later this evening: https://antimatter15.com/2015/12/recovering-deleted-data-from-leveldb/

May be able to grok out the suspended urls with this method.

florinvirdol commented 3 years ago

I was able to manual recover my lost suspended tabs after Chrome webstore removal of the The Great suspender extension by the following steps:

bluesealjs commented 3 years ago

I had over two hundreds of important tabs ..wtf, how can I recover it, chrome just auto removed the great malware.

scarrrr316 commented 3 years ago

https://github.com/greatsuspender/thegreatsuspender/issues/1304#issuecomment-773534043 this method worked perfectly !!!!!!! i export all my tabs through this method !!! try it

GarlicAAZ commented 3 years ago

I was trying to move my saved sessions from the "malware" version of TGS to the "marvellous suspender" (should work for the "pre-malware" 7.1.6 version too) and this method worked for me:

clach04 commented 3 years ago

Another alternative, backup history database and then export it. Basically combine

Issue>

.headers on
.mode csv
.output my-history.csv
SELECT datetime(last_visit_time/1000000-11644473600,'unixepoch','localtime'), url FROM urls where url like 'chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/suspended.html%' ORDER BY last_visit_time DESC;
bluesealjs commented 3 years ago

I don't want to use this malware anymore, what is an alternative extension and I can import the TGS saved sessions, any idea?

bluesealjs commented 3 years ago

This malware should be sued in the court!

quetzalcoatl commented 3 years ago

so... who actually is mantaining this project now?

adamhigerd commented 3 years ago

The successor project can be found at https://github.com/gioxx/MarvellousSuspender

bluesealjs commented 3 years ago

I have heard they have assigned a new maintainer so that the original maintainer won't take the blame, I guess they knew what they were doing.

parautenbach commented 3 years ago

Another alternative, backup history database and then export it. Basically combine

Issue>

.headers on
.mode csv
.output my-history.csv
SELECT datetime(last_visit_time/1000000-11644473600,'unixepoch','localtime'), url FROM urls where url like 'chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/suspended.html%' ORDER BY last_visit_time DESC;

Following up on @clach04's helpful snippet and as I'm going through the process of recovery: You can run the following on the resulting CSV file to get a list of the URLs/URIs.

grep klbibkeccnjlkjkiokjodocebajanakg my-history.csv |grep -Eo "uri=(.+)" |cut -d = -f 2 >recovered_tabs.txt

There are numerous other ways to achieve the same thing using awk, sed, etc. – this one works for me. YMMV – depending on your platform.

Once you have the file, you can check this SO post for running through that file and open all those links. Just be mindful of not trying to open too many at once since you'll probably bring Chrome and your system to its knees – which would be the very reason you've been using the extension.

tbal commented 3 years ago

For me this way worked:

EDIT: Does not work for all tabs in my case.. :|

ghost commented 3 years ago

This extension is removed from google it been found to contain found malware by the abuse team. google page for the extension shows a 404 error.

johanlunds commented 3 years ago

I was able to manual recover my lost suspended tabs after Chrome webstore removal of the The Great suspender extension by the following steps:

  • in: C:\Users\__YOUR_USER_NAME__\AppData\Local\Google\Chrome\User Data\Default\IndexedDB\chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob\1\__SOME_NUMBER__ i found a file (eg.: 26b3)
  • opened that file in VS Code
  • a message appeared: "The file is not displayed in the editor because it is either binary or uses an unsupported text encoding. Do you want to open it anyway?"
  • after opening, i searched for uri=https:// followed by "�width" and those were the lost suspended links

Thanks, this worked great!

I used your solution and wrote this Ruby script to export the most recently saved tab URLs to a JSON file:

MAKE A BACKUP OF THE FILES FIRST!

require 'json'

file = Dir['chrome-extension_klbibkeccnjlkjkiokjodocebajanakg_0.indexeddb.blob/**/*']
  .find_all { |f| File.file?(f)  } # skip folders, only check actual files
  .max_by { |f| File.mtime(f) } # get the most recently modified file

res = {}

read = File.read(file)
read.force_encoding("ASCII-8BIT")
regex = /uri=(https?\:\/\/.+?)\"\x05width/n
result = read.scan(regex)
res[file] = result.flatten

IO.write('result.json', JSON.pretty_generate(res))
basilisk487 commented 3 years ago

Can confirm, method recommended by @GarlicAAZ works perfectly and doesn't require going through your entire history. Just a couple of things:

To summarize, the sequence should be the following:

rodkey commented 3 years ago

Any way to recover lost tabs? can we temporary enable the extension? image

Here's a way that worked for me to recover the lost tabs: strings "./Library/Application Support/Google/Chrome/Default/History" | grep klbibkeccnjlkjkiokjodocebajanakg | sed 's/.*uri=//' >~/suspendedurls The created file suspendedurls will be in time order, most recent last.