Skip to content

Commit afabf17

Browse files
committed
Bug 1858545: put macOS attribution reporting behind a Nimbus flag r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D190986
1 parent f9befd3 commit afabf17

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

browser/app/profile/firefox.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,3 +2863,8 @@ pref("cookiebanners.ui.desktop.cfrVariant", 0);
28632863
// Whether the reset private browsing panel should ask for confirmation before
28642864
// performing the clear action.
28652865
pref("browser.privatebrowsing.resetPBM.showConfirmationDialog", true);
2866+
2867+
// bug 1858545: Temporary pref to enable a staged rollout of macOS attribution Telemetry
2868+
#ifdef XP_MACOSX
2869+
pref("browser.attribution.macos.enabled", false);
2870+
#endif

browser/components/attribution/AttributionCode.sys.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
1616
const lazy = {};
1717
ChromeUtils.defineESModuleGetters(lazy, {
1818
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
19+
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
1920
});
2021
ChromeUtils.defineLazyGetter(lazy, "log", () => {
2122
let { ConsoleAPI } = ChromeUtils.importESModule(
@@ -230,6 +231,17 @@ export var AttributionCode = {
230231
return gCachedAttrData;
231232
}
232233

234+
// This is a temporary block while we rollout macOS attribution.
235+
if (
236+
AppConstants.platform == "macosx" &&
237+
!lazy.NimbusFeatures.attribution.getVariable("macosEnabled")
238+
) {
239+
lazy.log.debug(
240+
"getAttrDataSync: macOS attribution disabled by nimbus; skipping"
241+
);
242+
return {};
243+
}
244+
233245
gCachedAttrData = {};
234246
let attributionFile = this.attributionFile;
235247
if (!attributionFile) {

browser/components/attribution/test/browser/browser.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[DEFAULT]
22
support-files = ["head.js"]
3+
prefs = ["browser.attribution.macos.enabled=true"]
34

45
["browser_AttributionCode_Mac_telemetry.js"]
56
skip-if = ["toolkit != 'cocoa'"] # macOS only telemetry.

browser/components/attribution/test/xpcshell/xpcshell.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
firefox-appdir = browser
33
skip-if = (os != "win" && toolkit != "cocoa") # Only available on Windows and macOS
44
head = head.js
5+
prefs =
6+
browser.attribution.macos.enabled=true
57

68
[test_AttributionCode.js]
79
[test_MacAttribution.js]

browser/components/newtab/test/browser/browser.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ prefs = [
2222
"browser.newtabpage.activity-stream.feeds.section.topstories.options={\"provider_name\":\"\"}",
2323
"messaging-system.log=all",
2424
"intl.multilingual.aboutWelcome.languageMismatchEnabled=false",
25+
"browser.attribution.macos.enabled=true",
2526
]
2627

2728
["browser_aboutwelcome_attribution.js"]

browser/components/newtab/test/xpcshell/xpcshell.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ skip-if = toolkit == 'android' # bug 1730213
55
prefs =
66
browser.startup.homepage.abouthome_cache.enabled=true
77
browser.startup.homepage.abouthome_cache.testing=true
8+
browser.attribution.macos.enabled=true
89

910
[test_AboutHomeStartupCacheChild.js]
1011
[test_AboutHomeStartupCacheWorker.js]

toolkit/components/nimbus/FeatureManifest.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,3 +1908,12 @@ feltPrivacy:
19081908
setPref: browser.privatebrowsing.resetPBM.enabled
19091909
description: >-
19101910
Enables the reset PBM feature button and confirmation panel.
1911+
1912+
attribution:
1913+
description: Prefs related to install attribution
1914+
hasExposure: false
1915+
variables:
1916+
macosEnabled:
1917+
type: boolean
1918+
description: Whether or not macOS attribution data will be processed and sent in Telemetry
1919+
fallbackPref: browser.attribution.macos.enabled

toolkit/components/telemetry/tests/unit/xpcshell.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ support-files =
1919
generated-files =
2020
system.xpi
2121
restartless.xpi
22+
prefs =
23+
browser.attribution.macos.enabled=true
2224

2325
[test_UserInteraction.js]
2426
[test_UserInteraction_annotations.js]

0 commit comments

Comments
 (0)