Commits:
-
d912ca8d
by Pier Angelo Vendrame at 2023-02-23T16:15:59+01:00
fixup! Base Browser's .mozconfigs.
Bug 41629: Set MOZ_SERVICES_SYNC to False
-
f0d123b1
by Pier Angelo Vendrame at 2023-02-23T16:17:30+01:00
Bug 41629: Fix errors with MOZ_SERVICES_SYNC=False
MOZ_SERVICES_SYNC should have been removed in Moz Bug 1227361.
However, it is still available, so we would like to use it.
Since it is a configuration that Mozilla does not test, and using it
results in a build error and in a few runtime errors, too.
This commit fixes them.
We have an upstream bug, too, but its (proposed) fix does not apply to
ESR 102 because of ESMification.
Should it not be accepted, we could replace this commit with the
poposed fix.
Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1816969
5 changed files:
Changes:
browser/base/content/browser-sync.js
... |
... |
@@ -5,7 +5,11 @@ |
5
|
5
|
// This file is loaded into the browser window scope.
|
6
|
6
|
/* eslint-env mozilla/browser-window */
|
7
|
7
|
|
8
|
|
-const { UIState } = ChromeUtils.import("resource://services-sync/UIState.jsm");
|
|
8
|
+ChromeUtils.defineModuleGetter(
|
|
9
|
+ this,
|
|
10
|
+ "UIState",
|
|
11
|
+ "resource://services-sync/UIState.jsm"
|
|
12
|
+);
|
9
|
13
|
|
10
|
14
|
ChromeUtils.defineModuleGetter(
|
11
|
15
|
this,
|
... |
... |
@@ -342,7 +346,9 @@ var gSync = { |
342
|
346
|
// once syncing completes (bug 1239042).
|
343
|
347
|
_syncStartTime: 0,
|
344
|
348
|
_syncAnimationTimer: 0,
|
345
|
|
- _obs: ["weave:engine:sync:finish", "quit-application", UIState.ON_UPDATE],
|
|
349
|
+ _obs: AppConstants.MOZ_SERVICES_SYNC
|
|
350
|
+ ? ["weave:engine:sync:finish", "quit-application", UIState.ON_UPDATE]
|
|
351
|
+ : [],
|
346
|
352
|
|
347
|
353
|
get log() {
|
348
|
354
|
if (!this._log) {
|
... |
... |
@@ -458,7 +464,7 @@ var gSync = { |
458
|
464
|
|
459
|
465
|
this._definePrefGetters();
|
460
|
466
|
|
461
|
|
- if (!this.FXA_ENABLED) {
|
|
467
|
+ if (!AppConstants.MOZ_SERVICES_SYNC || !this.FXA_ENABLED) {
|
462
|
468
|
this.onFxaDisabled();
|
463
|
469
|
return;
|
464
|
470
|
}
|
... |
... |
@@ -1529,7 +1535,7 @@ var gSync = { |
1529
|
1535
|
// can lead to a empty label for 'Send To Device' Menu.
|
1530
|
1536
|
this.init();
|
1531
|
1537
|
|
1532
|
|
- if (!this.FXA_ENABLED) {
|
|
1538
|
+ if (!AppConstants.MOZ_SERVICES_SYNC || !this.FXA_ENABLED) {
|
1533
|
1539
|
// These items are hidden in onFxaDisabled(). No need to do anything.
|
1534
|
1540
|
return;
|
1535
|
1541
|
}
|
... |
... |
@@ -1564,7 +1570,7 @@ var gSync = { |
1564
|
1570
|
|
1565
|
1571
|
// "Send Page to Device" and "Send Link to Device" menu items
|
1566
|
1572
|
updateContentContextMenu(contextMenu) {
|
1567
|
|
- if (!this.FXA_ENABLED) {
|
|
1573
|
+ if (!AppConstants.MOZ_SERVICES_SYNC || !this.FXA_ENABLED) {
|
1568
|
1574
|
// These items are hidden by default. No need to do anything.
|
1569
|
1575
|
return false;
|
1570
|
1576
|
}
|
browser/components/BrowserGlue.jsm
... |
... |
@@ -719,10 +719,10 @@ let JSWINDOWACTORS = { |
719
|
719
|
},
|
720
|
720
|
};
|
721
|
721
|
|
722
|
|
-XPCOMUtils.defineLazyGetter(
|
723
|
|
- this,
|
724
|
|
- "WeaveService",
|
725
|
|
- () => Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
|
|
722
|
+XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
|
|
723
|
+ AppConstants.MOZ_SERVICES_SYNC
|
|
724
|
+ ? Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
|
|
725
|
+ : null
|
726
|
726
|
);
|
727
|
727
|
|
728
|
728
|
if (AppConstants.MOZ_CRASHREPORTER) {
|
... |
... |
@@ -2693,7 +2693,7 @@ BrowserGlue.prototype = { |
2693
|
2693
|
// Schedule a sync (if enabled) after we've loaded
|
2694
|
2694
|
{
|
2695
|
2695
|
task: async () => {
|
2696
|
|
- if (WeaveService.enabled) {
|
|
2696
|
+ if (WeaveService?.enabled) {
|
2697
|
2697
|
await WeaveService.whenLoaded();
|
2698
|
2698
|
WeaveService.Weave.Service.scheduler.autoConnect();
|
2699
|
2699
|
}
|
browser/installer/package-manifest.in
... |
... |
@@ -179,7 +179,17 @@ |
179
|
179
|
@RESPATH@/browser/components/MacTouchBar.manifest
|
180
|
180
|
@RESPATH@/browser/components/MacTouchBar.js
|
181
|
181
|
#endif
|
|
182
|
+; TODO: Remove this in ESR-115.
|
|
183
|
+; If everything goes well, this patch will not be necessary in 115, because we
|
|
184
|
+; have also an upstream bug.
|
|
185
|
+; I suspect this is somehow incorrect, and that MOZ_SERVICES_SYNC is actually
|
|
186
|
+; never defined for the makefile (it is not for Firefox 112, which builds
|
|
187
|
+; correctly with MOZ_SERVICES_SYNC == False, even without this ifdef).
|
|
188
|
+; But we are interested in disabling it, so using either this, or #if 0 would be
|
|
189
|
+; fine for us.
|
|
190
|
+#ifdef MOZ_SERVICES_SYNC
|
182
|
191
|
@RESPATH@/components/SyncComponents.manifest
|
|
192
|
+#endif
|
183
|
193
|
@RESPATH@/components/servicesComponents.manifest
|
184
|
194
|
@RESPATH@/components/servicesSettings.manifest
|
185
|
195
|
@RESPATH@/components/cryptoComponents.manifest
|
browser/moz.configure
... |
... |
@@ -7,7 +7,8 @@ |
7
|
7
|
imply_option("MOZ_PLACES", True)
|
8
|
8
|
# tor-browser#32493
|
9
|
9
|
imply_option("MOZ_SERVICES_HEALTHREPORT", False)
|
10
|
|
-imply_option("MOZ_SERVICES_SYNC", True)
|
|
10
|
+# tor-browser#41629
|
|
11
|
+imply_option("MOZ_SERVICES_SYNC", False)
|
11
|
12
|
imply_option("MOZ_DEDICATED_PROFILES", True)
|
12
|
13
|
imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", True)
|
13
|
14
|
# tor-browser#33734
|
toolkit/modules/moz.build
... |
... |
@@ -291,6 +291,7 @@ for var in ( |
291
|
291
|
for var in (
|
292
|
292
|
"MOZ_ALLOW_ADDON_SIDELOAD",
|
293
|
293
|
"MOZ_BACKGROUNDTASKS",
|
|
294
|
+ "MOZ_SERVICES_SYNC",
|
294
|
295
|
"MOZ_SYSTEM_NSS",
|
295
|
296
|
"MOZ_SYSTEM_POLICIES",
|
296
|
297
|
"MOZ_UNSIGNED_APP_SCOPE",
|
|