backupOneTab icon indicating copy to clipboard operation
backupOneTab copied to clipboard

Does it really work, though?

Open ikki4 opened this issue 4 years ago • 12 comments

I've been testing this, and have not been able to successfully restore the backups.

ikki4 avatar Feb 21 '21 18:02 ikki4

Hey @ikki4, I've been testing this again too and the restore function kinda works but not really. The data stored in leveldb seems to have the local storage data. After restoring, if you look in the Chrome dev tools local storage, you should be able to see an oldState key which has a list of all the tab groups. However, I think that OneTab changed some functionality, because when I restored to an earlier backup with only a few saved tabs, it still showed all my recent tabs in addition to those early tabs. This leads me to believe that OneTab is now saving it's data somewhere else. I am going to do some investigating and push out a fix if I can.

joshuachough avatar Feb 27 '21 18:02 joshuachough

Almost 10 days ago Onetab updated, and a lot of people have lost their tabs. I was looking for an alternative/solution when I found yours and decided to try it out. I figured that Onetab's update might've also broken your solution, so that's why I posted this issue. I'm happy that you're trying to help out, thank you so much. I wish that Onetab devs were more communicative, or at least more open about how/where they save the saved tabs' informationm so we could automate the backups.

It's funny to find out about your project, because I also intended to use Selenium + Onetab's import/export feature to auto backup the saved tabs, but I also couldn't make it work.

ikki4 avatar Feb 28 '21 01:02 ikki4

I am glad I'm not alone in trying to protect people from the OneTab Lost All Tabs phenomenon. I also wish the OneTab devs were more communicative. At the time, I had thought they had abandoned the project, so the losing all your tabs thing was due to outdated code, but thanks to you, now I know that they're still developing it.

I also thought Selenium was going to be the best way, since they have that export feature built in, but Chrome doesn't seem to want us to access extension pages.

Today, I tried looking through their encrypted source code, but the encrypted variable names made things stupidly hard, so I just ended up reaching out to them on their website.

I also am suspecting that maybe the files in C:\Users\<Username>\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\chphlpgkkbolifaimnlloiipkdnihall may be where they're storing some of their data, but haven't tested my theory yet, so feel free to check it out.

joshuachough avatar Feb 28 '21 03:02 joshuachough

They've been over 2 years without updating it, so a lot of us thought that it was abandoned.

I was gonna say that probably backing up both

C:\Users\<Username>\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\chphlpgkkbolifaimnlloiipkdnihall

and

C:\Users\<Username>\AppData\Local\Google\Chrome\User Data\Default\Local Storage\leveldb

would be enough for your backup solution to work properly again, but then I opened the "000003.log" file (the largest file, and also the most recent one) inside ...\Local Extension Settings\chphlpgkkbolifaimnlloiipkdnihall, and this file contains a lot of information, including my current saved tabs and what looks like older tabs that I've already removed. Hopefully this means that the devs are working on a better way of saving our tabs, and even if it's not true, hopefully we'll be able to better understand that file, to make a better backup tool!

ikki4 avatar Feb 28 '21 16:02 ikki4

There's a .log file inside C:\Users\<Username>\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\chphlpgkkbolifaimnlloiipkdnihall that's keeping backups of our tabs!

So, I still can't parse correctly through that file (can't find the right encoding that does not return invalid characters), but it looks like the file contains json dumps of data of our saved tabs. I loaded that file in python (using readlines method) and I got a list with 31 entries, each entry seems to have one or more copies of all saved tabs (from multiple dates), or one or more tab groups. If you could find out the right encoding, and if you could parse correctly as json, you'll pretty much figure out all the logic behind this file, and you'd be able to make a very effective backup tool (or tabs extractor).

As I said, backing up those 2 folders from my other comment will probably work too, but figuring out this log file could make the backup tool even better.

ikki4 avatar Feb 28 '21 18:02 ikki4

Wow! Seems like there's hope! Thanks for looking into it @ikki4. I'll check out that .log file and try to figure out the correct way to read it.

If you make any more progress and want to contribute, feel free to fork and make a PR.

joshuachough avatar Mar 01 '21 04:03 joshuachough

The extension has updated again. I don't know what's changed, though.

ikki4 avatar Mar 07 '21 21:03 ikki4

I created a pull request with that new path. Also note this comment.

PS: Maybe interesting for you, since it seems that you have a lot / important info in OneTab: I wrote a simple script that helps you find duplicates in OneTab

dpschen avatar May 28 '21 10:05 dpschen

I was able to get the 000003.log file, but I'm still not sure how to encode it to get my tabs back. Could someone explain how they did that if successful? Thanks!!

rnsngh avatar Sep 28 '21 10:09 rnsngh

@rnsngh:

I was able to get the 000003.log file, but I'm still not sure how to encode it to get my tabs back. Could someone explain how they did that if successful? Thanks!!

Since I also didn't work for me anymore i wrote some workaround. Maybe that helps.

After finished I found onetab-export-to-json but didn't test it yet.

dpschen avatar Sep 28 '21 11:09 dpschen

I managed to write a Python script that extracts the tabs' links and urls from that .log file and saves them in a text file. The script can be further automated with Windows Task Manager.

Check it out: https://github.com/ikki4/OneTab-Exporter

It curently can identify tab groups, but can't save information about group name and status (stared, locked, etc).

ikki4 avatar Oct 04 '21 19:10 ikki4

Much better option: https://github.com/ikki4/OneTab-Backup-Automation

ikki4 avatar Oct 12 '21 20:10 ikki4