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

Store settings via cloud storage to easily sync across devices #1972

Open
sfrassanito opened this issue Jan 31, 2024 · 11 comments
Open

Store settings via cloud storage to easily sync across devices #1972

sfrassanito opened this issue Jan 31, 2024 · 11 comments
Assignees
Labels
Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@sfrassanito
Copy link

sfrassanito commented Jan 31, 2024

PROBLEM:

Today one needs to export/import settings in JSON to keep settings synched across multiple devices.

SOLUTION:

Sync settings in cloud storage. Similar to how uBlock Origin does (Push/Pull). From one device one can Push the settings and store them, from another device one can Pull them and apply them to the local instance.

ALTERNATIVES:

RELEVANCE / SCOPE:

"SIDE EFFECTS":

CONTEXT:
//
Thank you!

SHORT Table (Summary)
Problem
Solution
Alternatives
Scope
Side effects
Context
@sfrassanito sfrassanito added Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Jan 31, 2024
@josephShokry
Copy link
Contributor

@ImprovedTube I'd like to try solving this issue

@ImprovedTube
Copy link
Member

wonderful! @josephShokry

@josephShokry
Copy link
Contributor

@ImprovedTube is there a cloud serive you prefer me to use or just use google drive

@ImprovedTube
Copy link
Member

hi! @josephShokry

For Browser extensions (like uBlock origin) we can use chrome.storage.sync, since it doesnt require permission. It is limited to 100kb (enough yet) (and should be fastest/instant): #1656 ( chrome documentation, requires no change firefox )
( compare: #1408 )

Google drive also makes sense if most users are logged in to YouTube (besides it will have to request a google drive permission. "PocketTube" for example also added this feature. (We may also use Google Drive te day we continue this amazing extension: Smart History Manager (try it?) +it could consider data at myactivity.google in future)

@josephShokry
Copy link
Contributor

@ImprovedTube I am currently working on the issue and I am making progress!
I have used chrome.storage.sync as you suggested
but with this solution, we can sync the settings within the same web browser and Google account not within different web browsers if I push the settings from Google Chrome I can't pull it from Firefox
This is an issue we can work on later, what do you think?
also I have sent you an email, please answer me as soon as possible.

@ImprovedTube
Copy link
Member

amazing! @josephShokry ( congratulations! @sfrassanito 😃 )

( Could also sync changes all them time as an option or by default🤔.
Makes sense for many features, while some would require to compare screen resolution)

if I push the settings from Google Chrome I can't pull it from Firefox

Since we cant use the same browser user account for both(, can we?)
https://chromewebstore.google.com/detail/extension-sync/kimbiihomiiklblgkdllffbakadjgako

i just meant: https://stackoverflow.com/a/48030606 (+ [safari does it automated by now] )(https://developer.apple.com/documentation/safariservices/safari_web_extensions/syncing_safari_web_extensions_across_devices_and_platforms) )


looking forward to get google drive too 😃

@ImprovedTube
Copy link
Member

ImprovedTube commented Feb 8, 2024

BTW, just another story about Settings data: We should count the popularity of each feature to prioritize our work.
(how often they are enabled in total and how often each feature is changed per day)
We placed a whole JSON object in a google analytics URL before for BETA users. (But didnt continue anything there and removed google analytics. could also just append settings to the end of the iframe URL improvedtube.com/wishes or anything)

We (and other extensions) mostly have toggles & dropdowns (Next to our custom colors and video ID history / analyzer) (so that for example the minimum requirement to store 120 toggles in fixed order would be 120 bit or only 20 chars when converted to base64. So one could even allow to export/import/share profiles as a short code or URL like YouTube.com/0001000000010000010000001000)

extension settings
extension settings

@sfrassanito
Copy link
Author

Than you @josephShokry and @ImprovedTube.

I like the idea of having Google Drive as storage (maybe as second option, as it likely requires users to do additional authentication), as that would allow to use potentially any browser.

Also, a future enhancement could be that settings can be set to automatically be pulled if the local version is older than the remote one, so the extension would automatically update its settings in all browsers. I haven't seen this in any extension yet, but I don't see any downside so far.

@josephShokry
Copy link
Contributor

Thank you @sfrassanito for this interesting issue and @ImprovedTube for the second opportunity to contribute to such a wonderful extension.

in the case of the future enhancement you @sfrassanito suggested I was going to implement it but recognized that the issue is requiring not to be automatically updated instead the user should push and pull so that is what I did but I totally agree that automatically updated is better and we can make the feature to be activated or deactivated why not?
you can make it a new issue and if I have the time it will be my pleasure to contribute to this enhancement.

@sfrassanito
Copy link
Author

@josephShokry, I created a new feature request for the future as you suggested. Ref. #1999.

@josephShokry
Copy link
Contributor

@ImprovedTube last thing in this issue, there is a repeated code because of the old export and import functions and the new sync are almost the same the difference is the way to save them so it would be better if the took the functionality of saving and loading settings away in another function and called this functions in the old and new methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

3 participants