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:
Claude
2026-03-26 14:42:18 +00:00
parent f05375c2ec
commit 1e475196d6
6 changed files with 70 additions and 9 deletions
+3 -2
View File
@@ -147,8 +147,9 @@
Pick the same folder in each browser once. Changes are written to
<code>silent-send-sync.json</code> automatically whenever settings change,
and read back whenever this page is opened or regains focus.
Use a shared folder (Dropbox, OneDrive, iCloud Drive, or any network share)
for cross-computer sync too.
Works with <strong>any cloud storage that has a desktop sync client</strong>
Dropbox, OneDrive, Google Drive, iCloud Drive, Box, pCloud, Nextcloud,
Synology Drive, or any network share. Just pick the cloud-synced folder.
</p>
<div class="bulk-actions" style="align-items:center">
<button class="btn btn-primary" id="btnPickSyncFolder">Choose Sync Folder</button>
+5 -1
View File
@@ -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;