Open Durgesh4993 opened 7 months ago
Wait a minute, not everyone uses chrome, and not everyone uses sync.
chrome.storage.sync.set
While this addition might be beneficial to those that do, it shouldnt remove settings raw file import/export like your pull request does.
Wait a minute, not everyone uses chrome, and not everyone uses sync.
Firefox implements the storage.sync api, though I don't know the details of how it works if you don't have sync enabled.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync
hi and thanks! @Durgesh4993 @raszpl @timtoo
we allow the use chrome.storage.sync on press of a button since @josephShokry's last PR #1994
we use chrome.storage.local in all browsers
Hah I didnt even notice sync was already supported, so this patch just deletes manual file settings import/export while breaking sync. Weird.
Description:
Using this alternative approach simplifies the code by leveraging the built-in capabilities of the browser's storage synchronization mechanism, eliminating the need for custom export/import logic. It also ensures that the extension's settings are automatically synchronized across the user's devices without requiring explicit user actions for exporting/importing data.
In this alternative approach:
chrome.storage.sync
API is used directly to synchronize extension settings with the user's Google Account, enabling automatic data synchronization across devices where the user is signed in.syncSettings
function saves the entire extension storage data to the synced storage.pullSettings
function retrieves all data from the synced storage and updates the extension's local storage with the synced data.Code Changes: