The Great Suspender -- easily convert SB sessions [TUTORIAL]

1,262 views
Skip to first unread message

user102...@gmail.com

unread,
Aug 19, 2018, 7:21:15 PM8/19/18
to Session Buddy Discussion

The Great Suspender, for the members than doesn't know, is a great "chrome extension for suspending all tabs to free up memory"
(links: old version chrome web store: https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg/ for advanced users - more recent development version with instructions: https://github.com/deanoemcke/thegreatsuspender )

This guide is helpful for example to move sessions between computers without The Great Suspender chrome extension.

Steps for converting a Session Buddy session to remove suspended TGS url's:

1) Click on the sessions you want to convert, or select a few from Session Buddy's left panel by holding CTRL key.

2) click on the cogwheel 'settings' icon and then Export.

3) Click: JSON > Select 'Sessions, Windows, Titles, URLs' > Ensure that 'Selected' is chosen > Save to File.

4) Open Notepad++ (download link). Open the Json file saved earlier.

5) Click CTRL+H for Search and Replace. > Under 'Search Mode' choose 'Regular Expression'.

6) Next to:
 'Find What': Copy this line: 
"url": "chrome-extension://[a-z]{32}/suspended.html#ttl=.*(http[s]?\:\/\/.[a-zA-Z0-9\.\/\_?=%&#\-\+!]+\"\,)

'Replace with:'
"url": "\1

7) Click 'Replace All' and Save the file.

8) Back to Chrome window with Session Buddy opened, Click on clogwheel icon ("settings") > Click 'Import',

9) Click 'Select File', choose the saved Json File, after the conversion. Click 'Save'.

10) You have a new unsuspended saved session on the left panel. Hooray!



* This was really quick and dirty, should work with all thegreatsuspender current versions. if someone want to make the regex better you are welcome :)
* For admins: if links for other software are not appropriate around here, you may feel free to remove them.

user102...@gmail.com

unread,
Sep 14, 2018, 9:08:01 AM9/14/18
to Session Buddy Discussion
::ADDITIONS:

1) in step 5, you might need to select 'Wrap Around' if replacement didn't work.

2) The Great Discarder updated to a more recent version on chrome web store, It should be safer to install the extension from.

user102...@gmail.com

unread,
Sep 14, 2018, 9:11:20 AM9/14/18
to Session Buddy Discussion

2018-09-14 16_08_16-sessionbuddy-TGS-REPLACE.png


john s wolter

unread,
Sep 14, 2018, 2:20:26 PM9/14/18
to sessionbud...@googlegroups.com
First this is SPAM.  

Second there are better choices that are easier to use.  You described way too much work to perform a simple task.  I'd tried your extension a year or two ago and rejected it.

Try "One Tab" for example, among other extensions, works together with Session Buddy using one click of the mouse.  It is like a scratch pad where you can suspend a window's tabs & restore them later per window or per tab.  It's capacity is convenient & usable for several windows at a time.  

Session Buddy is a great project manager & archive tool for my work.   Using One Tab's store of windows, restored windows of tabs can then be labelled saved into Session Buddy.  Note that Session Buddy can do the same as One Tab with a few more keystrokes.

I also use an expanded Clipboard utility, Ditto, for M$-Windows.  It's store is as large as permitted for Windows files.  I can gather URLs for example & using Session Buddy's Import feature, create sessions.  You can native install Ditto into Windows or use it through PortableApss.com utility.  That utility has a large enough catalog of portable versions of programs that are not native installed & can cover most common activities.

I install PortableApps itself but portable programs within its directory structure.  I believe there is a portable version too..  I can then copy that entire directory structure as a PortableApps backup to a flash drive then restore a copy onto another Windows computer.  If you use its Documents directory your data & documentst go onto the flash drive as well.

When my computers misbehave I just move to another computer to continue working until I fix the problem.

Cheers,
John S. Wolter
------------------------------------------------------------
Wolter Works, LLC
EMail: johns...@wolterworks.com
LinkedIn: John S Wolter, johnswolter




On Fri, Sep 14, 2018 at 9:11 AM <user102...@gmail.com> wrote:

2018-09-14 16_08_16-sessionbuddy-TGS-REPLACE.png


--
You received this message because you are subscribed to the Google Groups "Session Buddy Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sessionbuddy-dis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

user102...@gmail.com

unread,
Sep 14, 2018, 3:52:18 PM9/14/18
to Session Buddy Discussion
Hi John,
You should consider contributing to this group to help the unexperienced.

For sure it is not spam, it was a recommendation for an Open-Source extension, that could help the productivity of multi-tabbing users like myself.

I took the time to write a guide that can assist others while experiencing, you can edit your post to do that too.

john s wolter

unread,
Sep 14, 2018, 6:10:19 PM9/14/18
to sessionbud...@googlegroups.com

Interesting suggestion.  Where are you located on Planet Earth?


Cheers,
John S. Wolter
------------------------------------------------------------
Wolter Works, LLC
EMail: johns...@wolterworks.com
LinkedIn: John S Wolter, johnswolter



Message has been deleted

psychorat5

unread,
Feb 8, 2021, 9:58:58 AM2/8/21
to Session Buddy Discussion
I was looking for the regular expression to replace that part of the text and i manage to do it like this

1) Save the sessions in Json file
2) Open the Json with Notepad++
3) Open the Replace text option and check the regular expressions check box
4) On "Find what" i put this regular expression   (chrome-extension.+uri=)
     On "Replace with" i put nothing.
5) Check if the selection is correct, then  hit  "Replace all"
This will clear out all chrome extensions that got injected in the Session Buddy's entries.

 If you know that there are more extensions involved than this and you want to keep these (not in my case), just add The great suspender code like this so only these will get removed.
(chrome-extension://klbibkeccnjlkjkiokjodocebajanakg.+uri=)

Stanislav Sobolev

unread,
Feb 12, 2021, 1:26:07 PM2/12/21
to Session Buddy Discussion
This is shit. 


I made a script


```
const url = require('url');
const querystring = require('querystring');

if (process.argv[2]) {
var parsedValue = url.parse(process.argv[2]);
console.log(querystring.parse(parsedValue.hash).uri);
} else {
 console.log('Run: node parseSuspendedTab.js "SUSPENDED_URL"')
}

```

It's dope

Run by
```
node script.js 'chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/suspended.html#ttl=A%20megacorp%20is%20not%20your%20dream%20job&pos=0&uri=https://drewdevault.com/2021/01/01/Megacorps-are-not-your-dream-job.html?utm_source=hackernewsletter&utm_medium=email&utm_term=working'
```

You will get a clear URL in stdout 

GinCali

unread,
Feb 13, 2021, 6:28:41 PM2/13/21
to Session Buddy Discussion
For those of us who are a bit more challenged, do we use your script by using the same first steps laid out by @psych? 1) Save the sessions in Json file

2) Open the Json with Notepad++
3) Open the Replace text option and check the regular expressions check box
4) On "Find what" i put this regular expression   (chrome-extension.+uri=)
?

Or does yours work another way?

TIA

Wolf Gang

unread,
Dec 22, 2024, 4:50:29 PM12/22/24
to Session Buddy Discussion
Can you write such js script so it can be used in indexeddb ?

Allen Kwan

unread,
Dec 27, 2024, 7:16:31 AM12/27/24
to Session Buddy Discussion
Can someone describe a way to do this with Session Buddy v4 export json files?

Since it's all on one line, I'm not sure how to use regex to remove the great suspender URLs at the beginning of the URLs.

Thanks.

Wolf Gang

unread,
Dec 29, 2024, 7:50:13 PM12/29/24
to Session Buddy Discussion
Here's a python script for it... You''re gonna have to download python 3.12. And then drag and drop the .json file on the .py file (paste this script into it):

import json
import re
import sys
import os

# Function to process the URLs in the JSON data
def process_json(data):
    pattern = re.compile(r"chrome-extension://.*?/suspended\.html#ttl=.*?&uri=")

    def clean_url(url):
        return pattern.sub('', url)

    if isinstance(data, dict):
        for key, value in data.items():
            if key == "url" and isinstance(value, str):
                data[key] = clean_url(value)
            else:
                process_json(value)
    elif isinstance(data, list):
        for item in data:
            process_json(item)

# Main function to handle file operations
def main():
    if len(sys.argv) != 2:
        print("Please drag and drop a JSON file onto this script.")
        return

    file_path = sys.argv[1]

    if not os.path.isfile(file_path):
        print("The provided file path is invalid.")
        return

    try:
        # Read the JSON file
        with open(file_path, 'r', encoding='utf-8') as file:
            data = json.load(file)

        # Process the JSON data
        process_json(data)

        # Save the processed JSON back to a file
        output_file = os.path.join(os.path.dirname(file_path), "processed_" + os.path.basename(file_path))
        with open(output_file, 'w', encoding='utf-8') as file:
            json.dump(data, file, indent=4)

        print(f"Processed file saved as {output_file}")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    main()
Reply all
Reply to author
Forward
0 new messages