Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it really work, though? #1

Open
ikki4 opened this issue Feb 21, 2021 · 12 comments
Open

Does it really work, though? #1

ikki4 opened this issue Feb 21, 2021 · 12 comments

Comments

@ikki4
Copy link

ikki4 commented Feb 21, 2021

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

@joshuachough
Copy link
Owner

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.

@ikki4
Copy link
Author

ikki4 commented Feb 28, 2021

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.

@joshuachough
Copy link
Owner

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.

@ikki4
Copy link
Author

ikki4 commented Feb 28, 2021

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
Copy link
Author

ikki4 commented Feb 28, 2021

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.

@joshuachough
Copy link
Owner

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.

@ikki4
Copy link
Author

ikki4 commented Mar 7, 2021

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

@dpschen
Copy link

dpschen commented May 28, 2021

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

@rnsngh
Copy link

rnsngh commented Sep 28, 2021

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!!

@dpschen
Copy link

dpschen commented Sep 28, 2021

@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.

@ikki4
Copy link
Author

ikki4 commented Oct 4, 2021

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
Copy link
Author

ikki4 commented Oct 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants