webextensions/live-css-editor

Feature Request: Persistence across Devices

Opened this issue · 4 comments

It would be nice if the css + preference data was retained across devices using chrome.storage or something. Every time I need to make a small change to a website I frequently use I have to update the css across all my devices, which can be time-consuming.

@Christopher-Hayes
I am preparing some changes for using chrome.storage.local (potentially with an import/export functionality, which may come now or later).

Retaining it across devices can be achieved via chrome.storage.sync, but that has quota limitations (https://developer.chrome.com/apps/storage#property-sync) which may not be sufficient for all possible use-cases. But still, it can be added with a strong warning.

While this issue is still applicable, a major part of its dependency has been fixed in latest master (a27f700).

After the latest version of the extension gets published, the user would be able to switch between localStorage and chrome.storage.local (default). The data would be auto-migrated between these two storages on per site usage.

That change opens up the door for the next functionality to export/import the data manually or via some automated means (eg: Connecting with GitHub gists).

@Christopher-Hayes

It has been one year since this issue was created.

Good news:
A limited alpha version of the requested feature is now implemented. The new version, 8.3.0, has been submitted to Chrome Web Store for the review process.

Bad news:
The chrome.storage.sync is heavily limited and the extension implementation isn't optimized to utilize the maximum out of it. The updated version would be able to handle data up to around 50 sites (Note: A warning is added in the options page of the extension, to try only if using for up to 25 sites).

I guess the bad news would mean that a significant chunk of the use case intended by this issue wouldn't be covered (Assuming that many users use it for more than 50 sites).

Potential solutions:

  • Optimize the storage and then the extension can be used for up to around 500 / 250 / 150 sites, depending on the data structure of 1 / 2 / 3 storage objects per site. (Relatively, easiest change)
  • Use GitHub gists API to mimic the required behavior (Not sure how efficient would that be in terms of network requests)
  • Rather than using Chrome/Firefox Sync, Use some internet based JSON storage system, which supports functionalities similar to Chrome/Firefox Sync (Would be a bigger change, but a better option in terms of architecture)
  • Use a package like https://github.com/dtuit/chrome-storage-largeSync to utilize the maximum out of available space (It would still miss out some edge cases around heavy usages of the extension ; Not sure how efficient would that be in terms of network requests)

I have left a note in https://github.com/webextensions/live-css-editor/blob/master/TODO.md about looking for an improved solution which may take some time before getting realized.

Awesome!