AsciiJakob / NoDistractions

Simple, bloat-free website blocker with a focus on intuitiveness
https://addons.mozilla.org/en-US/firefox/addon/nodistractions-website-blocker/
MIT License
3 stars 1 forks source link

Feature Idea: Use sync for blocklist #6

Closed AsciiJakob closed 2 months ago

AsciiJakob commented 2 months ago

Currently the list of blocked sites ( blockedSites_V1) is using browser.storage.local.set. Of course, this is fine, but some users may find it preferable if the extension has its blocklist synced between different firefox browsers that use the same firefox account. This can be achieved using storage.syncinstead of `storage.local.

I have yet to look into how it works, but I would imagine that storage.sync would not work when there is no firefox sync enabled, therefore this option should probably be an option and should be disabled by default.

This feature would probably also benefit from the extension adding a "reset blocked sites" in settings, as users would no longer be able to reinstall the extension to get rid of the their blocklist.

I am unsure whether this feature is worth implementing or not as of right now, this is due to the fact that no one has requested it and so it may just add unnecessary complexion. If anyone finds it interesting, feel free to either request it or make a merge request.

tuurep commented 2 months ago

Hey, this might actually be dead simple to just pretty much use the sync storage instead of local:

https://discourse.mozilla.org/t/does-the-sync-storage-browser-storage-sync-serve-as-local-storage-for-users-who-disabled-syncing/107816

Sync storage is just a normal storage that’s synced to other devices once in a while. So if you are offline or without Firefox Account, it will behave just like a normal “storage.local”.

but

Except… Unlike normal storage, this one has HUGE limitations in terms of capacity (100KB), single item size (8KB), number of items (512), number of changes per minute and others…

^ Do you think that would be an issue with the blocklist?

AsciiJakob commented 2 months ago

I don't claim responsibility if someone has more than 512 blocked sites 😂. The extension is not designed to handle that many.

Sync storage is just a normal storage that’s synced to other devices once in a while. So if you are offline or without Firefox Account, it will behave just like a normal “storage.local”.

That's pretty neat. Although I think some people may have sync setup but don't want to sync it between their different devices. I can't think of any reason why anyone would do this, but I feel like there may be some cases where they'd want that. Hence we would still need an option for it.

To conclude I'd like to say this probably won't be added, unless someone comes up with a good rreason why it should. Another good reason for this is because the addon already has exporting and importing of the blocklist already implemented, which serves the same function for the most part

tuurep commented 2 months ago

Yeah it's possible.

Also true about the import/export, which is why sync is only needed if someone uses this addon in a very dynamic way constantly adjusting which sites are blocked and which aren't. And uses more than one device with the same list :D

So seems reasonable

AsciiJakob commented 2 months ago

Closing this for now, if anyone really wants it then I might reconsider it