feat: sync notification badge + clarify cloud storage support
Notification system:
- When sync applies data (file folder, browser account, or sync code),
ss_sync_notification is written to local storage with the source.
- Service worker catches it via storage.onChanged, shows a purple 'SYN'
badge on the extension icon that persists until Options is opened, and
fires a desktop notification ('Settings updated via sync folder — open
Options to review').
- Clicking the desktop notification opens the Options page directly.
- On service worker wake, SYN badge is restored if the notification was
not yet dismissed.
- Opening Options clears ss_sync_notification, resets the badge, and
sends a sync:notification-seen message to the service worker.
- Added 'notifications' permission to both manifests.
Cloud storage clarity:
- Options page now explicitly lists that the folder sync works with any
cloud storage that has a desktop sync client: Dropbox, OneDrive, Google
Drive, iCloud Drive, Box, pCloud, Nextcloud, Synology Drive, etc.
https://claude.ai/code/session_01TKpSR9M8JgHLXCp5CeDsQP
This commit is contained in:
@@ -96,6 +96,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
});
|
||||
|
||||
// --- File-based auto-sync ---
|
||||
// Tell the service worker the user has seen any pending sync notification
|
||||
api.runtime.sendMessage({ type: 'sync:notification-seen' }).catch(() => {});
|
||||
await api.storage.local.remove('ss_sync_notification');
|
||||
|
||||
await initFileSync();
|
||||
|
||||
$('#btnPickSyncFolder').addEventListener('click', pickSyncFolder);
|
||||
@@ -559,7 +563,7 @@ async function checkFileSyncUpdate() {
|
||||
|
||||
const local = await SilentSendSync._getAllData();
|
||||
if (data.lastModified > (local.lastModified || 0)) {
|
||||
await SilentSendSync._applyData(data);
|
||||
await SilentSendSync._applyData(data, 'file');
|
||||
mappings = await Storage.getMappings();
|
||||
settings = await Storage.getSettings();
|
||||
$('#browserSync').checked = settings.browserSync === true;
|
||||
|
||||
Reference in New Issue
Block a user