feat(sync): implemented pinned tab sync with firefox sync engine #11264
+777
−214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Firefox Sync support for Zen Browser's Pinned Tabs, Essential Tabs, and Tab Folders, allowing users to sync their customized tab setup across multiple devices.
What This Does
Implementation
New Sync Engine
Created
ZenPinnedTabsSync.mjsthat implements a Firefox Sync engine following the standard Weave sync architecture:Change Tracking
Enhanced
ZenPinnedTabsStorage.mjsto track changes for sync:zen_pins_changestable to track modified pinsupdatePinTitle()to properly record title changes for syncAuto-Refresh on Sync
Modified
ZenPinnedTabManager.mjsto automatically apply synced changes:weave:engine:sync:finisheventseditedTitleflag to preserve custom tab nameszen-has-static-labelattribute to prevent title overwritesUI Integration
Technical Details
Synced Properties:
uuid- Unique identifiertitle- Tab title (original or custom)url- Tab URLeditedTitle- Flag indicating custom titlecontainerTabId- Container tab assignmentworkspaceUuid- Workspace assignmentposition- Tab position in sidebarisEssential- Essential tab statusisGroup- Folder indicatorparentUuid- Parent folder referencefolderIcon- Custom folder iconisFolderCollapsed- Folder collapsed stateTesting Instructions
Initial Setup
- Launch the browser
- Go to about:profiles (or use Firefox's new profile manager)
- Create a new profile and set it as default
- Go to Settings → Sync
- Sign in with your Firefox Account
- Enable "Pinned Tabs" and "Workspaces" in the sync options
- Create several pinned tabs (at least 5-6)
- Create a folder and add some tabs to it
- Create a nested folder (folder inside a folder)
- Rename some tabs to custom names (right-click → Rename)
- Change some folder icons (right-click folder → Change Icon)
- Mark some tabs as Essential
- Assign tabs to different workspaces (if using workspaces)
- Collapse/expand some folders
- Go to Settings → Sync
- Click "Sync Now" button
- Wait for sync to complete
- Create another new profile (or use a different device)
- Sign in with the same Firefox Account
- Enable "Pinned Tabs" in sync options
- Click "Sync Now"
- Verify all tabs, folders, and customizations appear correctly:
- On Device 2, make some changes (add tabs, rename something, create a folder)
- Sync Device 2
- Sync Device 1
- Verify changes appear on Device 1
- Make different changes to the same tab on both devices (e.g., rename it differently)
- Sync both devices
- Verify no data loss occurs (last-write-wins strategy)
Additional notes