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 · 62 comments
Open

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

alessiosacco opened this issue Nov 17, 2018 · 62 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
@ekasprzak
Copy link

@karypid it should be available when you right click on the extension (STG) icon.

@karypid
Copy link

karypid commented Sep 6, 2023

@karypid it should be available when you right click on the extension (STG) icon.

I have a few questions about this feature:

  1. How will you pick which data to use when the feature becomes available? Currently my desktop/laptop have slightly different tab groups as they do not get synced automatically. If I turn on the cloud sync, would one overwrite the other? How would you "control" which one should "win"? For example, if I want to keep the setup of my laptop and discard the one from my desktop, how would one go about turning that on?

  2. Would you be able to set the location where tabs are saved in cloud? Like some key name if firefox sync storage is used, or some folder name if gist/gdrive is used? This way if you use multiple profiles via firefox - ProfileManager you can configure a different location for each profile. In the bookmarks case you seem to be limited unable to 3 locations (Bookmarks Toolbar, Bookmarks Meni, and Other Bookmarks):

image

The way (1) is related to (2) is that I chose "Other bookmarks" in both my laptop and my desktop and I've ended up with two entries (one from each machine):

image

I am not sure how to get STG to restore the state saved in the bookmarks. Is this the second option that reads "Reopen tabs with temporary containers in new"?:

image

@brian163
Copy link

brian163 commented Mar 18, 2024

I feel like I've read this thread about 500 times. As @karypid noted, I enabled access to bookmarks and set the default bookmark location to "Other Bookmarks". After enabling backups (once a minute to test) and checking the Other Bookmarks folder, I now have multiple "Simple Tab Groups" folders for each computer. Is this the intended behavior? Because that doesn't really provide a way to keep the groups in sync. And I just can't tell if that is the shortcoming this thread keeps referring to at different stages of the implementation over time or if it just isn't working properly? (What I thought would happen is that there was one "Simple Tabs Groups" folder in Other Bookmarks and each browser would simply use the same folder.

Can someone please clarify? And if this is the shortcoming, do you simply keep "re-importing" your groups into new groups and manually deleting the previous ones? It will also get progressively challenging to keep track of what folder is from which computer with them all named the same. Which is why I have the feeling this isn't actually working as intended.

Signed,
Confused. (brian) :-)

@vvirtues
Copy link

vvirtues commented Mar 21, 2024

I feel like I've read this thread about 500 times. As @karypid noted, I enabled access to bookmarks and set the default bookmark location to "Other Bookmarks". After enabling backups (once a minute to test) and checking the Other Bookmarks folder, I now have multiple "Simple Tab Groups" folders for each computer. Is this the intended behavior? Because that doesn't really provide a way to keep the groups in sync. And I just can't tell if that is the shortcoming this thread keeps referring to at different stages of the implementation over time or if it just isn't working properly? (What I thought would happen is that there was one "Simple Tabs Groups" folder in Other Bookmarks and each browser would simply use the same folder.

Can someone please clarify? And if this is the shortcoming, do you simply keep "re-importing" your groups into new groups and manually deleting the previous ones? It will also get progressively challenging to keep track of what folder is from which computer with them all named the same. Which is why I have the feeling this isn't actually working as intended.

Signed, Confused. (brian) :-)

#291 (comment)
All we can do is wait (or contribute/donate). Yes, that behaviour is intended (well, not really) but the developer is doing their best to create an alternative sync solution that will be more usable

@vvirtues
Copy link

Actually, I'm not sure if the developer is active right now. The previous commits are showing a "ghost author" (maybe just me) but seems like there's a problem with the account

@brian163
Copy link

#291 (comment) All we can do is wait (or contribute/donate). Yes, that behaviour is intended (well, not really) but the developer is doing their best to create an alternative sync solution that will be more usable

Thanks for the confirmation. Sadly, I'm stumbling across too may great add-on projects that seem to be dying a slow death.

@Shirkit
Copy link

Shirkit commented Mar 23, 2024

#291 (comment) All we can do is wait (or contribute/donate). Yes, that behaviour is intended (well, not really) but the developer is doing their best to create an alternative sync solution that will be more usable

Thanks for the confirmation. Sadly, I'm stumbling across too may great add-on projects that seem to be dying a slow death.

Yeah, it's not trivial to keep projects alive for long periods of time. This project seems to be maybe on the stage of security fixes only, we'll see on next big Firefox update with breaking changes if it will vanish.

Drive4ik pushed a commit that referenced this issue Mar 24, 2024
@Drive4ik
Copy link
Owner

Unfortunately, I'm going to have to switch to a more important task - migrating to manifest v3.
I know that this task is very important, but I didn't have time to work on the addon.
I'm still in Ukraine and we still have rocket attacks every 2-3 days. (https://alerts.in.ua/en) I was a bit busy with other things. Now I will try to migrate the addon to manifest v3, otherwise the addon will stop working at all in the summer. Please understand. Thank you.

@Shirkit
Copy link

Shirkit commented Mar 24, 2024

Unfortunately, I'm going to have to switch to a more important task - migrating to manifest v3. I know that this task is very important, but I didn't have time to work on the addon. I'm still in Ukraine and we still have rocket attacks every 2-3 days. (https://alerts.in.ua/en) I was a bit busy with other things. Now I will try to migrate the addon to manifest v3, otherwise the addon will stop working at all in the summer. Please understand. Thank you.

I never wanted to criticize anything, as I've learned that people have their lives, and we can clearly see (since you live in Ukraine) that it's well understood why the work on the addon has halted.

The incredible only part here is you wanting to resume the work. At least now we know that, at least if this issue or other things in this addon does not get implemented, you'll at least try to keep it functional.

Thank you for using your time working in this great addon. Sync is the only thing missing for me to optimize my workflow.

@Drive4ik
Copy link
Owner

I totally missed it:
https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/

That's very good news.
Probably will continue to work on the current task.

@brian163
Copy link

@Drive4ik Very sorry you have to deal with that every day. I actually took note that your profile mentioned Ukraine and wondered to myself if that was a factor. But I appreciate you taking the time to respond and for any work you are able to continue on this great add-on. The sync issue was a bit of a show stopper for my personal needs at the moment but I'm more than interested in re-evaluating if it comes about at some point.

Thanks again for your contributions to improving the Firefox user experience!

Drive4ik pushed a commit that referenced this issue Jun 25, 2024
Drive4ik pushed a commit that referenced this issue Jul 3, 2024
Drive4ik pushed a commit that referenced this issue Jul 4, 2024
add alarm permission
refactor create local backup with alarm events
create cloud sync with alarm events
Drive4ik pushed a commit that referenced this issue Jul 6, 2024
Drive4ik pushed a commit that referenced this issue Jul 6, 2024
correct save options and groups
@benadrylcabbagepatch
Copy link

Ooh, I see some progress! Can't wait for cloud sync :D

Drive4ik pushed a commit that referenced this issue Sep 30, 2024
Drive4ik pushed a commit that referenced this issue Oct 4, 2024
…extension, for better restoring tabs between computers
Drive4ik pushed a commit that referenced this issue Oct 4, 2024
Drive4ik pushed a commit that referenced this issue Oct 6, 2024
@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

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