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

Add Firefox and Cloud Sync (GitHub Gist) support #291

Open
alessiosacco opened this issue Nov 17, 2018 · 78 comments
Open

Add Firefox and Cloud Sync (GitHub Gist) support #291

alessiosacco opened this issue Nov 17, 2018 · 78 comments

Comments

@alessiosacco
Copy link

The automatic backup of the tab groups is a very useful feature, but currently it is only usable in a single PC configuration, due to the fact that the backups are saved in the Downloads folder. Would it be possible to add the same functionality using Firefox Sync?

@devurandom
Copy link

I was wondering whether it would be possible to synchronise tab groups using Firefox Sync, too. My idea was to sync them as bookmarks (loosing history, but that is OK for me), potentially storing the group names in tags (allows having the same tab belong to multiple groups) or using bookmark folders (allowing just one group per tab, if that is more desirable from a design / implementation perspective).

@ghost
Copy link

ghost commented Dec 17, 2018

+1
Alternatively, if someone would figure out if/how we can sync hiddent tabs, that might solve this issue. But native support by the extension would be ace, I use sync a lot - opening work content at home, and vice versa.

@Drive4ik
Copy link
Owner

Drive4ik commented Jan 4, 2019

Hi all, I have been trying to implement this for a long time, but there is a restriction:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync

You can store up to 100KB of data using this API. If you try to store more than this, the call will fail with an error message.

If you have a lot of tabs, the data size will be more than 100KB. And then the problem, the solution of which adds only more problems ...

@ghost
Copy link

ghost commented Jan 9, 2019

Is there any way to make us see the total of all tabs in Firefox sync? Because when I move tabs to groups, on my other device I only see tabs which are in the open group, tabs from other groups are not shown and hence inaccessible.

As a use case, I use groups at work to group my work-related tabs into logical parts. When I get home and want to come back to some of my work tabs, I only see the active group tabs in my synced tabs, and other tabs are only accessible from my work device.

@Xima
Copy link

Xima commented Jan 11, 2019

I understand that synchronizing all tabs seems difficult, but it would be nice if at least we can synchronize groups and settings

@GonzRon
Copy link

GonzRon commented Feb 21, 2019

The solution is to allow backup of groups to bookmarks as in #328, that way you have 100KB data in firefox sync to store configuration.

@Drive4ik
Copy link
Owner

Hi all! I added option to export groups to bookmarks, you can sync groups/bookmarks this way
#328 (comment)

@ghost
Copy link

ghost commented Feb 28, 2019

Sorry, maybe I'm dumb, but I don't understand how I should use the new bookmark export to resolve syncing use cases. Can I set it up so that all my groups are periodically automatically bookmarked? Or can I only do it manually for each group?

@GonzRon
Copy link

GonzRon commented Feb 28, 2019

@hluposti you're quite right in that, this is not an automatic process.

Can I set it up so that all my groups are periodically automatically bookmarked?

Not currently, but maybe the author is working on some magic here :)

Or can I only do it manually for each group?

Currently this is the case.

The current implementation in #328 is not fully automatic. It can backup automatically, but not restore automatically. So it's not really a sync though it can kind of be used that way in a manual process. To implement sync functionality using #328, the author would need to use the functionality implemented in #328 a little bit differently.

One potential design approach would be to create a "SimpleTabGroupsSync" BookMark Folder, which STG would then automatically write all current STG Window groups. Second he would need to read this group if it exists on startup to make sure that the sync'ed bookmarks and the the current STG window groups match. To do this requires solving several hard computer science problems, something similar to a "cache invalidation" problem. He would have to keep a hash of every item in each STG window group to make sure existing items are updated and only new items are created, and vice versa. Or he can just start from scratch each time. It gets into the weeds quickly to try to implement this. He could potentially calculate a hash on the STGSync Bookmarks folder, or perhaps access a last sync'ed timestamp to know when he needs to update groups in STG from newly sync'ed bookmarks. The point is that this new implementation would require a private "STGSync BookMark Folder" which wouldn't be meant for any manual user interaction, which is how the current sync feature in #328 is implemented.

In other words, the facility to backup window groups using firefox sync has been accomplished via bookmarks (which works around firefox sync data size limitations), but that currently is a manual process, i.e. one that allows you to backup existing window groups individually.

@Drive4ik
Copy link
Owner

Didn't I already do it?
screenshot_1
screenshot_2

@GonzRon
Copy link

GonzRon commented Feb 28, 2019

Ah yes I didn't see that one! But how to import automatically from backup to new browser?

@Drive4ik
Copy link
Owner

@GonzRon
default

@GonzRon
Copy link

GonzRon commented Feb 28, 2019

Yes of course, I see that one. But I think this feature request is asking for automatic import from bookmark folders to groups. In other works automatic synchronization of window groups between browsers by using Firefox bookmarks to transfer the data.

Computer 1 --> Browser 1 --> STG Window Groups >>>> Automatic STG BookMarks Folder Backup
Computer 1 --> Browser 2 --> STG Window Groups <<<< Automatic STG BookMarks Folder Import

@Drive4ik
Copy link
Owner

Automatic import is not yet possible due to technical reasons of the browser.

@jbmorgado
Copy link

jbmorgado commented Mar 12, 2019

What about a one click loading of some specific backup file from the drop down menu?

The steps could be:

  • machine A: automatically create a backup named "machineA" (for instance) every hour (it already does that) in a shared folder (Dropbox, Syncthing or whatever the user has setup)
  • machine B: click the simple tab groups toolbar icon and hit the load icon in that menu (next to the "create new group" or something like that) and automatically import the new session from file (something that this extension already does)
  • machine B: automatically create a backup named "machineB" (for instance) every hour, allowing the same thing to be done on machine A when getting back to it

@Drive4ik
Copy link
Owner

Automatically save the file is only possible in the download folder. And adding it to Dropbox is unlikely.

@jbmorgado
Copy link

Any savvy user could do a symlink or a small script to copy that automatically to Dropbox/Syncthing/etc

@lx0n2acl
Copy link

I have a question about the backup to bookmark folder - it seems that when i close tabs from a tab group, they still remain in the backup and accumulate (i believe with a separator in between them). This might be the intended behavior for backups, but I tend to use this as a "sync" feature between browsers on different PCs. Therefore, it would be nice to have the option that the tabs are saved to the bookmarks "as is" - thereby replacing all the bookmarks in the previous backup. In other words, when i close a tab in the tab group, it will no longer appear in the backup, and this feature would operate as a true sync between browsers.

Is this possible as an option?

@Drive4ik
Copy link
Owner

@lx0n2acl Yes, I thought to make this functionality customizable, but for some reason I didn’t)) in the near future I will make an option in the settings for the controllability of this behavior (bookmarks without tabs that are closed)

@JackSlaterIV
Copy link

Automatic import is not yet possible due to technical reasons of the browser.

Hi Drive4ik, sorry if I reopen this old discussion.
I wonder if this could be of help, to create an auto sync from bookmarks functionality:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks
From what I see there, it looks like it can be done. Am I missing something else?
Thanks.

@jbmorgado
Copy link

I have been using Workona now. They just - finally - launched their plugin to Firefox. Works great so far, allows you to create groups much in the same manner as STG and automatically syncs across all your machines.

I had some sync problems with it on Chrome, but now on Firefox they are gone.

@Drive4ik
Copy link
Owner

Hi @JackSlaterIV
Nothing to worry about

Bookmark sync already implemented
enable bookmark permission
изображение

and then you can change auto backup folder name
изображение

manually create backup of all groups
изображение

or any group of your choice
изображение

изображение

Then bookmarks will be synchronized between devices (if bookmark synchronization is enabled in the settings in the browser)

@JackSlaterIV
Copy link

@Drive4ik
Thanks, but it does not automatically import from the bookmark folder, after the browser starts up.
Can you add this automatic import?
In one message above, you wrote that there was a technical issue in FF which blocked you from implementing this automatic import. Can you tell me more about it?

@Drive4ik
Copy link
Owner

@JackSlaterIV
Bookmarks do not have attachment to FF containers, and are unlikely to have it. Therefore, you cannot restore the bookmark in the desired container.
Some users have 3000+ tabs, you can imagine how much synchronization will take.
Also, one of the main problems - the addon cannot know when FF has finished its synchronization (bookmarks, settings, passwords, etc. that you have chosen in the browser settings) and this can take a lot of time (5+ min) and it is difficult for the addon to understand when to start synchronization, and this is very important, because you need to have the most recent "snapshot" of data, but bookmarks do not have this ...
When the FF increases the capacity https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync at least to 10 MB, then I will start to think how to implement this.
It’s just what immediately comes to mind, there are more minor problems.
But so far this is not feasible.

@whatsnewsisyphus
Copy link

whatsnewsisyphus commented Sep 24, 2020

@JackSlaterIV
Bookmarks do not have attachment to FF containers, and are unlikely to have it. Therefore, you cannot restore the bookmark in the desired container.
Some users have 3000+ tabs, you can imagine how much synchronization will take.
Also, one of the main problems - the addon cannot know when FF has finished its synchronization (bookmarks, settings, passwords, etc. that you have chosen in the browser settings) and this can take a lot of time (5+ min) and it is difficult for the addon to understand when to start synchronization, and this is very important, because you need to have the most recent "snapshot" of data, but bookmarks do not have this ...
When the FF increases the capacity https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync at least to 10 MB, then I will start to think how to implement this.
It’s just what immediately comes to mind, there are more minor problems.
But so far this is not feasible.

Hello @Drive4ik Thanks for the extension. Firefox will never have, and shouldn't have MB sync limits for the reasons you mentioned in terms of sync start-complete delays.

I do have a solution suggestion. A majority of the users are not having 3000+ tabs, and those who do should really look into using bookmarks, for the rest (and the majority of us) the following would work.

Apply simple lookup of current tab numbers and use firefox sync if they are under a safe margin (let's say 500). If they are above the safe margin, show a little alert on the top of the simple tab group window that says "Tabs Exceed Firefox Sync limits".

The sync issue is whats keeping me from adopting the plugin fully as others offer syncing. The groups really are most useful as a medium term management solution that is ideal for a desk to laptop workflow.

Let me know if I can help with UX suggestions, I am mostly a designer.

This was referenced Oct 7, 2020
@Drive4ik
Copy link
Owner

Drive4ik commented Oct 7, 2024

Hi everyone. 👋
I have made a test beta version of STG with support for tab/group/settings synchronization via github gist.
Please help with testing, identifying bugs and misbehavior. Please those who are knowledgeable and want to help with testing.
Attention, attached below is a TEST version of STG. This version needs to be installed on a brand new Firefox profile (about:profiles). You do everything at your own risk! Categorically do not advise to put this test version next to the main version in the main Firefox profile!
This version will be finalized and only then will go to the release.

So, what you need:

  1. Create a test Firefox account (after testing you can safely delete it at the bottom of the page https://accounts.firefox.com/settings).
  2. Create 2 new profiles in Firefox (about:profiles).
  3. Log in to the new 2 profiles in the new Firefox test account you created in step 1.
  4. Install the test version of STG in both of these profiles.
  5. Create a github token (classic or fine-grained) with write access to the gists at this link https://github.com/settings/tokens?type=beta
  6. Enter the token in the addon settings.
  7. Test, create new groups, tabs. Synchronize them, delete and generally do all the usual things you do in the browser.
    You can also restore your main backup, and see how the addon will behave under load.

Keep in mind the condition for deleting a tab: If a tab was deleted on the first profile/computer, synchronization occurred, on another profile/computer it will be deleted if it is not active or was active before synchronization on the first computer. I hope I explained it clearly) I mean, if the tab was deleted and not opened on another computer, it will be deleted there automatically.

Please ask what is unclear, and test only the synchronization functionality. Possible errors with logs should be sent by mail [email protected] with your github name. In this thread you can attach screenshots/videos of errors or incorrect behavior. So that I can connect logs in the mail and description in this thread. I hope for understanding.

Thanks a lot !!!

(unzip it) stg-sync-test-5.5.2.zip

@Shirkit
Copy link

Shirkit commented Oct 8, 2024

Hello! Tried installing it in Zen Browser and got "failed to install because addon is corrupt". I stopped using Firefox a month ago since Zen came out.

I'm running Zen Browser 1.0.1-a.7 (64-bit) in Ubuntu 24.04 as Flatpak

image

@Drive4ik
Copy link
Owner

Drive4ik commented Oct 9, 2024

@Shirkit you need to unzip first

@Shirkit
Copy link

Shirkit commented Nov 13, 2024

It errored when I tried it out. Since I stopped using Firefox and moved into Zen in this meantime, it took a long time to test this out, I'm sorry. I've just sent to you the full log in the email you provided.

Running on Zen 1.0.1-a.19 (Firefox 132.0.1) (64-bit) under Windows 11.

Gonna try on my Linux machine.

image

Here's a paste with just the error log part: https://pastebin.com/LCSq4CMs

@mrjianlucah
Copy link

I've the same issue.

Firefox 132.0.2 - Windows 11

@hentdisr
Copy link

same error, tested with both fine-grained and classic with all possible permissions

@hentdisr
Copy link

hentdisr commented Nov 30, 2024

created a workaround to get it started, need more testing to see if it fully works

  1. create manual backup
  2. go to https://gist.github.com and create a gist using the title of File name: in STG's settings (including STG- and .json) and add data from manual backup into file contents. Save as secret gist
  3. click start synchronization

lmk if this works for anyone else

Drive4ik pushed a commit that referenced this issue Dec 1, 2024
@mrjianlucah
Copy link

created a workaround to get it started, need more testing to see if it fully works

1. create manual backup

2. go to https://gist.github.com and create a gist using the title of `File name:` in STG's settings (including `STG-` and `.json`) and add data from manual backup into file contents. Save as secret gist

3. click start synchronization

lmk if this works for anyone else

Cool, it's working.

Thanks!

@vvirtues
Copy link

vvirtues commented Dec 3, 2024

@Drive4ik I believe it mostly works with the exception of the synchronization script not automatically creating the gist and instead throwing an error. other than that it's basically perfect

also another question, if you have one pc (B) which last had a group open before it was closed, and you have another PC (A) and update that same synced group with 2 new tabs. What happens when you reopen the browser on B?

Drive4ik pushed a commit that referenced this issue Dec 7, 2024
fully refactored send gist module
Drive4ik pushed a commit that referenced this issue Dec 11, 2024
@Drive4ik
Copy link
Owner

Drive4ik commented Dec 12, 2024

Hey, everybody! Sorry for the long absence. I see you've dealt with the error yourself)))) Thanks @hentdisr! I have completely refactor the logic of sending and receiving Gist, and the gistId is no longer saved. It was the reason for this error, there are too many situations to keep track of to not have this error. Since gistId is no longer saved, synchronization will take ~100-300 ms longer, but I think it's not a problem.
The instructions are the same, except that the attached file doesn't need to be unzipped.
@Shirkit you can just drag it to the about:addons page.

@vvirtues If I understand you correctly, when you open browser B, new 2 tabs will be created after synchronization. You can put the latest test version on a test Firefox profile and check how the addon behaves.

I am open to any discussion on this topic.
Thanks to all of you for helping me test :)

stg-sync-test-5.5.4.xpi.zip

Drive4ik pushed a commit that referenced this issue Dec 13, 2024
@mrjianlucah
Copy link

Hi all, when i'm going to start a new sync with the new Gist method, i've this issue: TypeError: extensionsStorage[id].hostPermissions is undefined

How can i solve it?

Thanks!

SCR-20241216-mvrc

@Drive4ik
Copy link
Owner

@mrjianlucah Hi! Thank you very much for your help! It was my mistake, it should be fixed in this version:
stg-sync-test-5.5.5.xpi.zip

@mrjianlucah
Copy link

@Drive4ik thanks a lot!

I've two questions:

  • is it possible to set the cloud backup in smaller times? for example every minute or two
  • how can i sync pinned tabs? I noticed that these are not inserted into the cloud file

thanks for your awesome work!

@Drive4ik
Copy link
Owner

@mrjianlucah Thanks to you!

  1. Unfortunately, for a regular user, there is a limit of 100 requests per hour for updating data. To increase the limit, you need to become an organization and/or pay for GitHub Enterprise Cloud.
    https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
  2. At the moment, the addon does not work with pinned tabs. There are quite a few browser usage scenarios where tabs are closed by the user, and the addon is not always able to restore them.
    In the future, if I have the motivation and time, I plan to add support for pinned tabs. I also have an idea to make this functionality as a plugin for STG, but I haven't tested it in practice yet. As you may have noticed, I haven't done the addon for a long time because of the war. Now I'm starting to do it again little by little)))

@karypid
Copy link

karypid commented Dec 16, 2024

is it possible to set the cloud backup in smaller times? for example every minute or two

May I ask what your use case is for this?

Personally I am not that interested in syncing too often, but more in being able to sync them across computers.

I mainly use my laptop and my desktop. My ideal way would be:

  • If I had a manual sync button that would be enough for me.
  • Even better would be to "sync when idle". So f (like I stop interacting for 5 minutes with the browser, then machine syncs. (This way if I leave my desktop and go outside for work, then after 5 mins the tabs would get synced.)

One thing that is a problem is that the tabs are stored in separate folders with the same name "Simple Tab Groups" . I would love to be able to use the same (so that changes on one location get automatically picked up in the other) but if this is not possible then at least being able to set the name would be nice (like if I could set "STG desktop" and "STG laptop").

@Drive4ik
Copy link
Owner

@karypid The button to synchronize is in the settings and in the popup itself. You can synchronize manually within the github api limit (100 changes per hour).
изображение

Regarding synchronicity when idle or locked, that's a good idea. I read, I don't remember where, that Firefox has problems with that. It can't detect computer downtime or something like that. Just checked the API and it doesn't work as I expect, it always returns “active” instead of “locked” or “idle”. I'll do some more searching on this topic for solutions.

@vvirtues
Copy link

image
I get this trying to import a backup on another device on both 5.5.4 and 5.5.5

@Drive4ik
Copy link
Owner

@vvirtues Hi! Please, can you enable debug mode (in settings at the bottom), replicate this error, stop debugging and send logs to my email?
Thanks for helping!

@vvirtues
Copy link

@vvirtues Hi! Please, can you enable debug mode (in settings at the bottom), replicate this error, stop debugging and send logs to my email? Thanks for helping!

sent

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