For add-ons installed before the changes introduced by Bug 1757760 ExtensionSettingStorage.getLevelOfControl resolves to "controlled_by_this_extension"
even if the user did not opt-in when prompted (either by never answer the prompt, or by setting No).
The changes landed by Bug 1757760 did make sure that for a newly installed extensions ExtensionSettingsStorage.getLevelOfControl resolves to "controllable_by_this_extension"
until the user actually explicitly opt-in to the default search engine provided by the installed extension, by making sure to initially set as disabled
the defaultSearch setting for a newly installed extension (which will then be enabled if the user does explicitly opt-in).
Unfortunately, that change doesn't have any effect if the extension has been installed in a Firefox version that did not yet include Bug 1757760 changes,
in that case the setting listed in the pre-existing extension-settings.json file in the Firefox profile will still have the setting marked
as enabled even if the user did never opt-in.
This patch includes a new test task that is injecting into extension-settings.json the data needed to recreate the inconsistent state
(level of control set to "controlled_by_this_extension" while the related search engine isn't actually set as default).
In addition to the new test case, this patch is applying the following changes to `chrome_settings_overrides`:
- in the `setDefault` method: if ExtensionSettingsStorage.getLevelOfControl resolves to "controlled_by_this_extension"
but the default search engine currently set is not the one associated to the extension, then explicitly disable the
setting and recompute the level of control (which will resolve to "controllable_by_this_extension" as a side effect
of explicitly disable the setting)
- in the `ensureSetting` method: remove the check on `item?.enabled`, because the result of ExtensionSettingsStorage.getSetting
does actually never have an `enabled` property set, instead it is part of the content of the extension-settings.json file
and it is used internally by ExtensionSettingsStorage without being returning in the format of the object returned by
calling ExtensionSettingsStorage.getSetting
(see https://searchfox.org/mozilla-central/rev/97c902e8f92b15dc63eb584bfc594ecb041242a4/toolkit/components/extensions/ExtensionSettingsStore.jsm#164-177)
Differential Revision: https://phabricator.services.mozilla.com/D146294
This implements reading the list from remote settings. We only read it at startup if necessary, or on add-on installation.
We do not check for updates - if something is removed, we'll wait until next startup before processing it.
Also adds lots of tests for canOverride as this seems a critical part to get right.
Differential Revision: https://phabricator.services.mozilla.com/D76473
This implements reading the list from remote settings. We only read it at startup if necessary, or on add-on installation.
We do not check for updates - if something is removed, we'll wait until next startup before processing it.
Also adds lots of tests for canOverride as this seems a critical part to get right.
Differential Revision: https://phabricator.services.mozilla.com/D76473
This provides a set of promises that the searchservice resolves once the search engine has been configured
Differential Revision: https://phabricator.services.mozilla.com/D33660
--HG--
extra : moz-landing-system : lando
This provides a set of promises that the searchservice resolves once the search engine has been configured
Differential Revision: https://phabricator.services.mozilla.com/D33660
--HG--
extra : moz-landing-system : lando
This provides a set of promises that the searchservice resolves once the search engine has been configured
Differential Revision: https://phabricator.services.mozilla.com/D33660
--HG--
extra : moz-landing-system : lando
API implementations that check shutdownReason for values other than
APP_SHUTDOWN during extension shutdown are inherently broken since an
addon may be disabled or uninstalled between browser sessions, in which
case code that is meant to run in these cases will not get executed.
This patch fixes existing api implementations that are broken in this way.
Also ensure that APIs' onDisabled methods get called properly when an
extension is disabled between browser sessions.
Differential Revision: https://phabricator.services.mozilla.com/D30604
--HG--
extra : rebase_source : 06518bcabbde9f8db3066c63524e8947f7a36ee2