summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-02-09 01:40:49 -0600
committerMatt A. Tobin <email@mattatobin.com>2022-02-09 01:40:49 -0600
commit455ee361df9a80e06e3c657b2462fa830efe497a (patch)
treea545db6b3c36fcd023bd0c5ff8fda447186d692b /components
parent6e8a2a4278e8de6e61d9d38226c7d38ed462dac4 (diff)
downloadaura-central-455ee361df9a80e06e3c657b2462fa830efe497a.tar.gz
No Issue - Remove Mozilla Experiments support from the Add-ons Manager
Diffstat (limited to 'components')
-rw-r--r--components/addons/content/extensions.css34
-rw-r--r--components/addons/content/extensions.xml47
-rw-r--r--components/addons/content/extensions.xul27
-rw-r--r--components/addons/locale/extensions.dtd11
-rw-r--r--components/addons/locale/extensions.properties39
-rw-r--r--components/addons/src/XPIProvider.jsm119
6 files changed, 17 insertions, 260 deletions
diff --git a/components/addons/content/extensions.css b/components/addons/content/extensions.css
index 51828d544..c483bcd56 100644
--- a/components/addons/content/extensions.css
+++ b/components/addons/content/extensions.css
@@ -200,10 +200,6 @@ setting[type="menulist"] {
display: none;
}
-#addons-page .view-pane:not([type="experiment"]) .experiment-info-container {
- display: none;
-}
-
.addon .relnotes {
-moz-user-select: text;
}
@@ -234,36 +230,6 @@ richlistitem:not([selected]) * {
display: none;
}
-#experiments-learn-more[disabled="true"] {
- display: none;
-}
-
-#experiments-change-telemetry[disabled="true"] {
- display: none;
-}
-
-.view-pane[type="experiment"] .error,
-.view-pane[type="experiment"] .warning,
-.view-pane[type="experiment"] .addon:not([pending="uninstall"]) .pending,
-.view-pane[type="experiment"] .disabled-postfix,
-.view-pane[type="experiment"] .update-postfix,
-.view-pane[type="experiment"] .version,
-#detail-view[type="experiment"] .alert-container,
-#detail-view[type="experiment"] #detail-version,
-#detail-view[type="experiment"] #detail-creator {
- display: none;
-}
-
-.view-pane:not([type="experiment"]) .experiment-container,
-.view-pane:not([type="experiment"]) #detail-experiment-container {
- display: none;
-}
-
-.addon[type="experiment"][status="installing"] .experiment-time,
-.addon[type="experiment"][status="installing"] .experiment-state {
- display: none;
-}
-
/* Translators for Language Pack details */
.translators > label {
-moz-margin-start: 0px;
diff --git a/components/addons/content/extensions.xml b/components/addons/content/extensions.xml
index 47f0b400d..9ea6a50df 100644
--- a/components/addons/content/extensions.xml
+++ b/components/addons/content/extensions.xml
@@ -864,16 +864,6 @@
<xul:label anonid="date-updated" class="date-updated"
unknown="&addon.unknownDate;"/>
</xul:hbox>
- <xul:hbox class="experiment-container">
- <svg width="6" height="6" viewBox="0 0 6 6" version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- class="experiment-bullet-container">
- <circle cx="3" cy="3" r="3" class="experiment-bullet"/>
- </svg>
- <xul:label anonid="experiment-state" class="experiment-state"/>
- <xul:label anonid="experiment-time" class="experiment-time"/>
- </xul:hbox>
-
<xul:hbox class="advancedinfo-container" flex="1">
<xul:vbox class="description-outer-container" flex="1">
<xul:hbox class="description-container">
@@ -1038,12 +1028,6 @@
<field name="_version">
document.getAnonymousElementByAttribute(this, "anonid", "version");
</field>
- <field name="_experimentState">
- document.getAnonymousElementByAttribute(this, "anonid", "experiment-state");
- </field>
- <field name="_experimentTime">
- document.getAnonymousElementByAttribute(this, "anonid", "experiment-time");
- </field>
<field name="_icon">
document.getAnonymousElementByAttribute(this, "anonid", "icon");
</field>
@@ -1405,37 +1389,6 @@
var showProgress = this.mAddon.purchaseURL || (this.mAddon.install &&
this.mAddon.install.state != AddonManager.STATE_INSTALLED);
this._showStatus(showProgress ? "progress" : "none");
-
- if (this.mAddon.type == "experiment") {
- this.removeAttribute("notification");
- let prefix = "experiment.";
- let active = this.mAddon.isActive;
-
- if (!showProgress) {
- let stateKey = prefix + "state." + (active ? "active" : "complete");
- this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
-
- let now = Date.now();
- let end = this.endDate;
- let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
-
- let timeKey = prefix + "time.";
- let timeMessage;
-
- if (days < 1) {
- timeKey += (active ? "endsToday" : "endedToday");
- timeMessage = gStrings.ext.GetStringFromName(timeKey);
- } else {
- timeKey += (active ? "daysRemaining" : "daysPassed");
- days = Math.round(days);
- let timeString = gStrings.ext.GetStringFromName(timeKey);
- timeMessage = PluralForm.get(days, timeString)
- .replace("#1", days);
- }
-
- this._experimentTime.value = timeMessage;
- }
- }
]]></body>
</method>
diff --git a/components/addons/content/extensions.xul b/components/addons/content/extensions.xul
index 70ce55fa2..a61bb6162 100644
--- a/components/addons/content/extensions.xul
+++ b/components/addons/content/extensions.xul
@@ -91,8 +91,6 @@
<command id="cmd_enableUpdateSecurity"/>
<command id="cmd_toggleAutoUpdateDefault"/>
<command id="cmd_resetAddonAutoUpdate"/>
- <command id="cmd_experimentsLearnMore"/>
- <command id="cmd_experimentsOpenTelemetryPreferences"/>
</commandset>
<!-- view commands - these act on the selected addon -->
@@ -354,22 +352,6 @@
<spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
</hbox>
</hbox>
- <hbox class="view-header global-info-container experiment-info-container">
- <hbox class="global-info" flex="1" align="center">
- <label value="&experiment.info.label;"/>
- <button id="experiments-learn-more"
- label="&experiment.info.learnmore;"
- tooltiptext="&experiment.info.learnmore;"
- accesskey="&experiment.info.learnmore.accesskey;"
- command="cmd_experimentsLearnMore"/>
- <button id="experiments-change-telemetry"
- label="&experiment.info.changetelemetry;"
- tooltiptext="&experiment.info.changetelemetry;"
- accesskey="&experiment.info.changetelemetry.accesskey;"
- command="cmd_experimentsOpenTelemetryPreferences"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap. -->
- </hbox>
- </hbox>
<vbox id="addon-list-empty" class="alert-container"
flex="1" hidden="true">
<spacer class="alert-spacer-before"/>
@@ -530,15 +512,6 @@
<label id="detail-creator" class="creator"/>
<label id="detail-translators" class="translators"/>
</vbox>
- <hbox id="detail-experiment-container">
- <svg width="8" height="8" viewBox="0 0 8 8" version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- id="detail-experiment-bullet-container">
- <circle cx="4" cy="4" r="4" id="detail-experiment-bullet"/>
- </svg>
- <label id="detail-experiment-state"/>
- <label id="detail-experiment-time"/>
- </hbox>
<hbox id="detail-desc-container" align="start">
<vbox pack="center"> <!-- Necessary to work around bug 394738 -->
<image id="detail-screenshot" hidden="true"/>
diff --git a/components/addons/locale/extensions.dtd b/components/addons/locale/extensions.dtd
index 098896d99..14f4973fb 100644
--- a/components/addons/locale/extensions.dtd
+++ b/components/addons/locale/extensions.dtd
@@ -216,15 +216,4 @@
<!ENTITY settings.path.button.label "Browse…">
-<!-- LOCALIZATION NOTE (experiment.info.label): The strings related to
- experiments are present on the "Experiments" tab of the add-ons manager.
- This tab won't be displayed unless an Experiment add-on is installed.
- Install https://people.mozilla.org/~gszorc/dummy-experiment-addon.xpi
- to cause this tab to appear. -->
-<!ENTITY experiment.info.label "What's this? Telemetry may install and run experiments from time to time.">
-<!ENTITY experiment.info.learnmore "Learn More">
-<!ENTITY experiment.info.learnmore.accesskey "L">
-<!ENTITY experiment.info.changetelemetry "Telemetry Settings">
-<!ENTITY experiment.info.changetelemetry.accesskey "T">
-
<!ENTITY setting.learnmore "Learn More…">
diff --git a/components/addons/locale/extensions.properties b/components/addons/locale/extensions.properties
index 51baa739b..43ab02a47 100644
--- a/components/addons/locale/extensions.properties
+++ b/components/addons/locale/extensions.properties
@@ -99,44 +99,6 @@ details.notification.uninstall=%1$S will be uninstalled after you restart %2$S.
#LOCALIZATION NOTE (details.notification.upgrade) %1$S is the add-on name, %2$S is brand name
details.notification.upgrade=%1$S will be updated after you restart %2$S.
-# LOCALIZATION NOTE (details.experiment.time.daysRemaining):
-# Semicolon-separated list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #1 is the number of days from now that the experiment will remain active (detail view).
-details.experiment.time.daysRemaining=#1 day remaining;#1 days remaining
-#LOCALIZATION NOTE (details.experiment.time.endsToday) The experiment will end in less than a day (detail view).
-details.experiment.time.endsToday=Less than a day remaining
-# LOCALIZATION NOTE (details.experiment.time.daysPassed):
-# Semicolon-separated list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #1 is the number of days since the experiment ran (detail view).
-details.experiment.time.daysPassed=#1 day ago;#1 days ago
-#LOCALIZATION NOTE (details.experiment.time.endedToday) The experiment ended less than a day ago (detail view).
-details.experiment.time.endedToday=Less than a day ago
-#LOCALIZATION NOTE (details.experiment.state.active) This experiment is active (detail view).
-details.experiment.state.active=Active
-#LOCALIZATION NOTE (details.experiment.state.complete) This experiment is complete (it was previously active) (detail view).
-details.experiment.state.complete=Complete
-
-# LOCALIZATION NOTE (experiment.time.daysRemaining):
-# Semicolon-separated list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #1 is the number of days from now that the experiment will remain active (list view item).
-experiment.time.daysRemaining=#1 day remaining;#1 days remaining
-#LOCALIZATION NOTE (experiment.time.endsToday) The experiment will end in less than a day (list view item).
-experiment.time.endsToday=Less than a day remaining
-# LOCALIZATION NOTE (experiment.time.daysPassed):
-# Semicolon-separated list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #1 is the number of days since the experiment ran (list view item).
-experiment.time.daysPassed=#1 day ago;#1 days ago
-#LOCALIZATION NOTE (experiment.time.endedToday) The experiment ended less than a day ago (list view item).
-experiment.time.endedToday=Less than a day ago
-#LOCALIZATION NOTE (experiment.state.active) This experiment is active (list view item).
-experiment.state.active=Active
-#LOCALIZATION NOTE (experiment.state.complete) This experiment is complete (it was previously active) (list view item).
-experiment.state.complete=Complete
-
installFromFile.dialogTitle=Select add-on to install
installFromFile.filterName=Add-ons
@@ -170,4 +132,3 @@ type.locale.name=Languages
type.plugin.name=Plugins
type.dictionary.name=Dictionaries
type.service.name=Services
-type.experiment.name=Experiments
diff --git a/components/addons/src/XPIProvider.jsm b/components/addons/src/XPIProvider.jsm
index 9ad10b534..e1ecfedcb 100644
--- a/components/addons/src/XPIProvider.jsm
+++ b/components/addons/src/XPIProvider.jsm
@@ -191,17 +191,18 @@ const BOOTSTRAP_REASONS = {
// Map new string type identifiers to old style nsIUpdateItem types
const TYPES = {
- extension: 2,
- theme: 4,
- locale: 8,
- multipackage: 32,
- dictionary: 64,
- experiment: 128,
+//app : 1,
+ extension : 2,
+ theme : 4,
+ locale : 8,
+ multipackage : 32,
+ dictionary : 64,
+//experiment : 128,
+//apiextension : 256,
};
const RESTARTLESS_TYPES = new Set([
"dictionary",
- "experiment",
"locale",
]);
@@ -952,11 +953,6 @@ function loadManifestFromRDF(aUri, aStream) {
addon.userDisabled = !!LightweightThemeManager.currentTheme ||
addon.internalName != XPIProvider.selectedSkin;
}
- // Experiments are disabled by default. It is up to the Experiments Manager
- // to enable them (it drives installation).
- else if (addon.type == "experiment") {
- addon.userDisabled = true;
- }
else {
addon.userDisabled = false;
addon.softDisabled = addon.blocklistState == Blocklist.STATE_SOFTBLOCKED;
@@ -964,17 +960,6 @@ function loadManifestFromRDF(aUri, aStream) {
addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
- // Experiments are managed and updated through an external "experiments
- // manager." So disable some built-in mechanisms.
- if (addon.type == "experiment") {
- addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DISABLE;
- addon.updateURL = null;
- addon.updateKey = null;
-
- addon.targetApplications = [];
- addon.targetPlatforms = [];
- }
-
// Load the storage service before NSS (nsIRandomGenerator),
// to avoid a SQLite initialization error (bug 717904).
let storage = Services.storage;
@@ -1837,8 +1822,6 @@ this.XPIProvider = {
// Keep track of the newest file in each add-on, in case we want to
// report it.
_mostRecentlyModifiedFile: {},
- // Experiments are disabled by default. Track ones that are locally enabled.
- _enabledExperiments: null,
// A Map from an add-on install to its ID
_addonFileMap: new Map(),
#ifdef MOZ_DEVTOOLS
@@ -2013,8 +1996,6 @@ this.XPIProvider = {
this.installLocationsByName = {};
// Hook for tests to detect when saving database at shutdown time fails
this._shutdownError = null;
- // Clear the set of enabled experiments (experiments disabled by default).
- this._enabledExperiments = new Set();
let hasRegistry = ("nsIWindowsRegKey" in Ci);
@@ -2328,13 +2309,9 @@ this.XPIProvider = {
* Persists changes to XPIProvider.bootstrappedAddons to its store (a pref).
*/
persistBootstrappedAddons: function XPI_persistBootstrappedAddons() {
- // Experiments are disabled upon app load, so don't persist references.
let filtered = {};
for (let id in this.bootstrappedAddons) {
let entry = this.bootstrappedAddons[id];
- if (entry.type == "experiment") {
- continue;
- }
filtered[id] = entry;
}
@@ -4498,15 +4475,11 @@ this.XPIProvider = {
let appDisabledChanged = aAddon.appDisabled != appDisabled;
// Update the properties in the database.
- // We never persist this for experiments because the disabled flags
- // are controlled by the Experiments Manager.
- if (aAddon.type != "experiment") {
- XPIDatabase.setAddonProperties(aAddon, {
- userDisabled: aUserDisabled,
- appDisabled: appDisabled,
- softDisabled: aSoftDisabled
- });
- }
+ XPIDatabase.setAddonProperties(aAddon, {
+ userDisabled: aUserDisabled,
+ appDisabled: appDisabled,
+ softDisabled: aSoftDisabled
+ });
if (appDisabledChanged) {
AddonManagerPrivate.callAddonListeners("onPropertyChanged",
@@ -6386,17 +6359,6 @@ AddonInternal.prototype = {
},
isCompatibleWith: function AddonInternal_isCompatibleWith(aAppVersion, aPlatformVersion) {
- // Experiments are installed through an external mechanism that
- // limits target audience to compatible clients. We trust it knows what
- // it's doing and skip compatibility checks.
- //
- // This decision does forfeit defense in depth. If the experiments system
- // is ever wrong about targeting an add-on to a specific application
- // or platform, the client will likely see errors.
- if (this.type == "experiment") {
- return true;
- }
-
let app = this.matchingTargetApplication;
if (!app)
return false;
@@ -6604,13 +6566,6 @@ AddonInternal.prototype = {
if (!(this.inDatabase))
return permissions;
- // Experiments can only be uninstalled. An uninstall reflects the user
- // intent of "disable this experiment." This is partially managed by the
- // experiments manager.
- if (this.type == "experiment") {
- return AddonManager.PERM_CAN_UNINSTALL;
- }
-
if (!this.appDisabled) {
if (this.userDisabled || this.softDisabled) {
permissions |= AddonManager.PERM_CAN_ENABLE;
@@ -6873,11 +6828,6 @@ function AddonWrapper(aAddon) {
return aAddon.applyBackgroundUpdates;
});
this.__defineSetter__("applyBackgroundUpdates", function AddonWrapper_applyBackgroundUpdatesSetter(val) {
- if (this.type == "experiment") {
- logger.warn("Setting applyBackgroundUpdates on an experiment is not supported.");
- return;
- }
-
if (val != AddonManager.AUTOUPDATE_DEFAULT &&
val != AddonManager.AUTOUPDATE_DISABLE &&
val != AddonManager.AUTOUPDATE_ENABLE) {
@@ -6945,12 +6895,10 @@ function AddonWrapper(aAddon) {
// Extensions have an intentional inconsistency between what the DB says is
// enabled and what we say to the ouside world. so we need to cover up that
// lie here as well.
- if (aAddon.type != "experiment") {
- if (aAddon.active && aAddon.disabled)
- pending |= AddonManager.PENDING_DISABLE;
- else if (!aAddon.active && !aAddon.disabled)
- pending |= AddonManager.PENDING_ENABLE;
- }
+ if (aAddon.active && aAddon.disabled)
+ pending |= AddonManager.PENDING_DISABLE;
+ else if (!aAddon.active && !aAddon.disabled)
+ pending |= AddonManager.PENDING_ENABLE;
if (aAddon.pendingUpgrade)
pending |= AddonManager.PENDING_UPGRADE;
@@ -6987,10 +6935,6 @@ function AddonWrapper(aAddon) {
});
this.__defineGetter__("userDisabled", function AddonWrapper_userDisabledGetter() {
- if (XPIProvider._enabledExperiments.has(aAddon.id)) {
- return false;
- }
-
return aAddon.softDisabled || aAddon.userDisabled;
});
this.__defineSetter__("userDisabled", function AddonWrapper_userDisabledSetter(val) {
@@ -6998,14 +6942,6 @@ function AddonWrapper(aAddon) {
return val;
}
- if (aAddon.type == "experiment") {
- if (val) {
- XPIProvider._enabledExperiments.delete(aAddon.id);
- } else {
- XPIProvider._enabledExperiments.add(aAddon.id);
- }
- }
-
if (aAddon.inDatabase) {
if (aAddon.type == "theme" && val) {
if (aAddon.internalName == XPIProvider.defaultSkin)
@@ -7063,14 +6999,6 @@ function AddonWrapper(aAddon) {
};
this.findUpdates = function AddonWrapper_findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
- // Short-circuit updates for experiments because updates are handled
- // through the Experiments Manager.
- if (this.type == "experiment") {
- AddonManagerPrivate.callNoUpdateListeners(this, aListener, aReason,
- aAppVersion, aPlatformVersion);
- return;
- }
-
new UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion);
};
@@ -7801,17 +7729,4 @@ var addonTypes = [
AddonManager.TYPE_UI_HIDE_EMPTY | AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL),
];
-// We only register experiments support if the application supports them.
-// Ideally, we would install an observer to watch the pref. Installing
-// an observer for this pref is not necessary here and may be buggy with
-// regards to registering this XPIProvider twice.
-if (Preferences.get("experiments.supported", false)) {
- addonTypes.push(
- new AddonManagerPrivate.AddonType("experiment",
- URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 11000,
- AddonManager.TYPE_UI_HIDE_EMPTY | AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL));
-}
-
AddonManagerPrivate.registerProvider(XPIProvider, addonTypes);