From 647e219639112664cef39563bb6de0da468e5937 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:18:08 +0200 Subject: [PATCH] gh-14470: Add space and container sync (gh-14471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kristijan Ribarić <96492763+kristijanribaric@users.noreply.github.com> Signed-off-by: mr. m <91018726+mr-cheffy@users.noreply.github.com> --- prefs/zen/sync.yaml | 12 + prefs/zen/workspaces.yaml | 3 - .../preferences/config/account-sync-mjs.patch | 20 + .../dialogs/syncChooseWhatToSync-js.patch | 2 +- .../dialogs/syncChooseWhatToSync-xhtml.patch | 2 +- .../preferences/sync-inc-xhtml.patch | 2 +- .../sync/modules/service-sys-mjs.patch | 15 + .../ContextualIdentityService-sys-mjs.patch | 37 ++ src/zen/moz.build | 1 + .../sessionstore/ZenSessionManager.sys.mjs | 11 + src/zen/spaces/ZenSpaceManager.mjs | 114 ++++- src/zen/sync/ZenSyncManager.sys.mjs | 160 +++++++ src/zen/sync/ZenWorkspacesSync.sys.mjs | 404 ++++++++++++++++++ src/zen/sync/moz.build | 8 + tools/ffprefs/src/main.rs | 11 + 15 files changed, 784 insertions(+), 18 deletions(-) create mode 100644 prefs/zen/sync.yaml create mode 100644 src/browser/components/preferences/config/account-sync-mjs.patch create mode 100644 src/services/sync/modules/service-sys-mjs.patch create mode 100644 src/toolkit/components/contextualidentity/ContextualIdentityService-sys-mjs.patch create mode 100644 src/zen/sync/ZenSyncManager.sys.mjs create mode 100644 src/zen/sync/ZenWorkspacesSync.sys.mjs create mode 100644 src/zen/sync/moz.build diff --git a/prefs/zen/sync.yaml b/prefs/zen/sync.yaml new file mode 100644 index 000000000..dff75e481 --- /dev/null +++ b/prefs/zen/sync.yaml @@ -0,0 +1,12 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +- name: services.sync.engine.spaces + value: true + condition: "@IS_TWILIGHT@" + +- name: services.sync.engine.spaces + value: false + locked: true + condition: "!@IS_TWILIGHT@" diff --git a/prefs/zen/workspaces.yaml b/prefs/zen/workspaces.yaml index 24aaf887c..dfa8b7d6c 100644 --- a/prefs/zen/workspaces.yaml +++ b/prefs/zen/workspaces.yaml @@ -32,9 +32,6 @@ - name: zen.workspaces.scroll-modifier-key value: ctrl -- name: services.sync.engine.workspaces - value: false - - name: zen.workspaces.separate-essentials value: true diff --git a/src/browser/components/preferences/config/account-sync-mjs.patch b/src/browser/components/preferences/config/account-sync-mjs.patch new file mode 100644 index 000000000..ce14b3e05 --- /dev/null +++ b/src/browser/components/preferences/config/account-sync-mjs.patch @@ -0,0 +1,20 @@ +diff --git a/browser/components/preferences/config/account-sync.mjs b/browser/components/preferences/config/account-sync.mjs +index b503987a08e2ce64bfc01c4e3a21e5e19ef834f0..b1c03a0b219fd3eddd93c1deaeb18ab79c85f168 100644 +--- a/browser/components/preferences/config/account-sync.mjs ++++ b/browser/components/preferences/config/account-sync.mjs +@@ -42,6 +42,7 @@ Preferences.addAll([ + { id: "services.sync.engine.creditcards", type: "bool" }, + { id: "services.sync.engine.addons", type: "bool" }, + { id: "services.sync.engine.prefs", type: "bool" }, ++ { id: "services.sync.engine.spaces", type: "bool" }, + ]); + + /** +@@ -546,6 +547,7 @@ const SYNC_ENGINE_SETTINGS = [ + type: "payments", + }, + { id: "syncAddons", pref: "services.sync.engine.addons", type: "addons" }, ++ { id: "syncSpaces", pref: "services.sync.engine.spaces", type: "workspaces" }, + { id: "syncSettings", pref: "services.sync.engine.prefs", type: "settings" }, + ]; + diff --git a/src/browser/components/preferences/dialogs/syncChooseWhatToSync-js.patch b/src/browser/components/preferences/dialogs/syncChooseWhatToSync-js.patch index e066aca21..da89f90fb 100644 --- a/src/browser/components/preferences/dialogs/syncChooseWhatToSync-js.patch +++ b/src/browser/components/preferences/dialogs/syncChooseWhatToSync-js.patch @@ -6,7 +6,7 @@ index 64aa0d98a0622c01f3dcfff1a04bfcda368354d2..2013e04b0881ad2295d6897b91e1573c { id: "services.sync.engine.passwords", type: "bool" }, { id: "services.sync.engine.addresses", type: "bool" }, { id: "services.sync.engine.creditcards", type: "bool" }, -+ { id: "services.sync.engine.workspaces", type: "bool" }, ++ { id: "services.sync.engine.spaces", type: "bool" }, ]); let gSyncChooseWhatToSync = { diff --git a/src/browser/components/preferences/dialogs/syncChooseWhatToSync-xhtml.patch b/src/browser/components/preferences/dialogs/syncChooseWhatToSync-xhtml.patch index 3b0ab370d..0ebce7576 100644 --- a/src/browser/components/preferences/dialogs/syncChooseWhatToSync-xhtml.patch +++ b/src/browser/components/preferences/dialogs/syncChooseWhatToSync-xhtml.patch @@ -20,7 +20,7 @@ index a893c5ec3d007820d98f5d92dd039640faa2c181..9cbd00102e44ccf98b37845474d92d57 + + + diff --git a/src/browser/components/preferences/sync-inc-xhtml.patch b/src/browser/components/preferences/sync-inc-xhtml.patch index 06944335a..4b6e6306d 100644 --- a/src/browser/components/preferences/sync-inc-xhtml.patch +++ b/src/browser/components/preferences/sync-inc-xhtml.patch @@ -6,7 +6,7 @@ index c379e1a5f82692406a92d9fcd3bca2769dfac5b2..af037dd3d995813d966524ac44a3795d