Commit graph

72 commits

Author SHA1 Message Date
Luca Greco
8f0e4349d0 Bug 1767550 - Make sure defaultSearch overrides levelOfControl is consistent with the default engine currently set before overriding the current default. r=mixedpuppy
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
2022-05-25 18:46:12 +00:00
Shane Caraveo
b1709f7b82 Bug 1757760 retain correct search default setting after addon update r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D141294
2022-03-18 19:43:43 +00:00
Shane Caraveo
20c17fee02 Bug 1705835 remove unused engineAdded extension setting r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D112432
2021-04-22 15:33:51 +00:00
Mark Banner
6ea0ba649c Bug 1702454 - Re-enabling an add-on that overrides search engine parameters shouldn't cause a prompt. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D110562
2021-04-15 15:57:41 +00:00
Shane Caraveo
eaa5799976 Bug 1698619 fix updating homepage setting on updates and for localization r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D110717
2021-04-12 18:58:27 +00:00
Shane Caraveo
9cade0a613 Bug 1646338 ask to set as default again when enabling a search addon r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D107132
2021-03-29 15:42:23 +00:00
Erica Wright
2e621affde Bug 1595858 - Allow users to select or deselect addons for homepage and newtab without disabling the addons. r=preferences-reviewers,Gijs,mixedpuppy,ahal
Differential Revision: https://phabricator.services.mozilla.com/D93584
2020-11-20 21:40:14 +00:00
Bogdan Tara
7b40f0b246 sBacked out changeset 26f7d3a8b1b6 (bug 1595858) for overrides related mochitest failures CLOSED TREE 2020-11-18 01:42:59 +02:00
Erica Wright
a0437a3853 Bug 1595858 - Allow users to select or deselect addons for homepage and newtab without disabling the addons. r=preferences-reviewers,Gijs,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D93584
2020-11-17 19:49:36 +00:00
Bogdan Tara
ca56bb2db5 Backed out changeset d86e4d6c2be4 (bug 1595858) for browser_ext_chrome_settings_overrides_home.js failures CLOSED TREE 2020-11-13 06:11:35 +02:00
Erica Wright
afcd271556 Bug 1595858 - Allow users to select or deselect addons for homepage and newtab without disabling the addons. r=preferences-reviewers,Gijs,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D93584
2020-11-13 02:02:47 +00:00
Mark Banner
171ca8fd0a Bug 1643858 - When an add-on is uninstalled at early startup, ensure that we also remove associated search engines. r=mixedpuppy,daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D95540
2020-11-04 11:20:45 +00:00
Mark Banner
4ed84161a4 Bug 1638888 - Make disabling and enabling a WebExtension restore the default search engine correctly. r=mixedpuppy,extension-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D76503
2020-06-16 08:54:24 +00:00
Mark Banner
191db56ecd Bug 1638888 - Simplify processSearchProviderManifestEntry to handle the not setting as default engine case first. r=mixedpuppy,extension-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D79271
2020-06-16 08:54:16 +00:00
Mark Banner
cc617abea2 Bug 1641261 - Handle the case when an app provided engine is hidden/removed, and a WebExtension wants to select as default. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D77429
2020-05-31 12:19:18 +00:00
Mihai Alexandru Michis
a46df46151 Backed out changeset d82a23f070f6 (bug 1641261) for causing xpcshell failures in test_override_allowlist.js
CLOSED TREE
2020-05-30 11:19:08 +03:00
Mark Banner
c562e03d91 Bug 1641261 - Handle the case when an app provided engine is hidden/removed, and a WebExtension wants to select as default. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D77429
2020-05-29 23:09:34 +00:00
Mark Banner
40cac5473a Bug 1635235 - Ensure browser_ext_settings_overrides_default_search.js can wait for search engine setup to complete to avoid intermittents. r=mixedpuppy
Depends on D76480

Differential Revision: https://phabricator.services.mozilla.com/D76910
2020-05-26 19:53:42 +00:00
Mark Banner
ceba0e848d Bug 1635235 - Implement reading the allow override default search engine allowlist from remote settings. r=daleharvey
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
2020-05-26 19:40:42 +00:00
Mihai Alexandru Michis
33899422e7 Backed out 2 changesets (bug 1635235, bug 1635239) for causing Bug 1640583.
CLOSED TREE

Backed out changeset 97ecda13df18 (bug 1635239)
Backed out changeset c9f80397bbec (bug 1635235)
2020-05-25 16:43:03 +03:00
Mark Banner
019b662f87 Bug 1635235 - Implement reading the allow override default search engine allowlist from remote settings. r=daleharvey
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
2020-05-24 21:45:41 +00:00
Mark Banner
3686adfd13 Bug 1635231 - Allow overriding and setting as default specific search engines according to a allowlist. r=daleharvey,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D75613
2020-05-21 10:42:20 +00:00
Dale Harvey
b8b5c3394a Bug 1621892 - Maintain engine settings when upgrading extension r=Standard8,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D68247

--HG--
extra : moz-landing-system : lando
2020-04-07 15:58:05 +00:00
Mark Banner
bb413bca06 Bug 1590803 - Clean up uses of SearchService.getDefaultEngines where we can now use engine.isAppProvided. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D69235

--HG--
extra : moz-landing-system : lando
2020-04-03 11:36:35 +00:00
Dorel Luca
af82b27122 Backed out 2 changesets (bug 1590803) for browser-chrome failures in browser/browser_placeholder.js. CLOSED TREE
Backed out changeset 6256694a9047 (bug 1590803)
Backed out changeset efd1d1868d70 (bug 1590803)

--HG--
extra : histedit_source : 0dfcd9580b8b8a2274402ba9f32f43a07b7854dd
2020-04-02 18:39:32 +03:00
Mark Banner
b85978d734 Bug 1590803 - Clean up uses of SearchService.getDefaultEngines where we can now use engine.isAppProvided. r=daleharvey
Depends on D69233

Differential Revision: https://phabricator.services.mozilla.com/D69235

--HG--
extra : moz-landing-system : lando
2020-04-02 14:31:45 +00:00
Shane Caraveo
43733c66c4 Bug 1578513 make disable/enable during safe mode update extension settings r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D44595

--HG--
extra : moz-landing-system : lando
2019-11-27 20:00:08 +00:00
Shane Caraveo
c00b26e5f3 Bug 1578513 make uninstall during safemode remove extension settings r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D44594

--HG--
extra : moz-landing-system : lando
2019-11-27 22:19:15 +00:00
monikamaheshwari
9d60e0d578 Bug 1578683 Turn on ESLint rule prefer-boolean-length-check for toolkit and browser r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D45629

--HG--
extra : moz-landing-system : lando
2019-09-14 09:39:26 +00:00
mandy cheang
48f276929d Bug 1566489 - Avoid reading extension-setting.json on start-up, read it lazily. r=aswan,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D40860

--HG--
extra : moz-landing-system : lando
2019-08-08 16:15:17 +00:00
Mark Banner
31fe00df28 Bug 1535049 - Add telemetry for the homepage ignore actions. r=daleharvey,chutten,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D40394

--HG--
extra : moz-landing-system : lando
2019-08-05 21:53:09 +00:00
Mark Banner
f41a03f6cb Bug 1535049 - Disallow setting homepages to ignored urls. r=daleharvey,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D40393

--HG--
rename : browser/modules/test/unit/test_HomePage.js => browser/modules/test/unit/test_HomePage_ignore.js
extra : moz-landing-system : lando
2019-08-05 21:52:59 +00:00
Brindusan Cristian
535145f197 Backed out 2 changesets (bug 1556789) on request from aryx for causing Bug 1565836. a=backout
Backed out changeset ca5fdf3a0ddd (bug 1556789)
Backed out changeset 19419ff4e756 (bug 1556789)
2019-07-13 20:52:45 +03:00
Shane Caraveo
36bce0da93 Bug 1556789 - Refactor extension install in searchservice to use promises r=robwu,daleharvey
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
2019-07-12 19:33:32 +00:00
Gurzau Raul
7a46596592 Backed out 2 changesets (bug 1556789) for assertion failures in FF functional tests on a CLOSED TREE.
Backed out changeset 2d10e95cf0cd (bug 1556789)
Backed out changeset 0acf6bafda0f (bug 1556789)
2019-07-12 04:45:46 +03:00
Shane Caraveo
b2cb7defd5 Bug 1556789 - Refactor extension install in searchservice to use promises r=robwu,daleharvey
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
2019-07-11 18:42:00 +00:00
Noemi Erli
6de41e7f85 Backed out 2 changesets (bug 1556789) for failures in test_engines_on_restart.py
Backed out changeset 5488dbd0fa34 (bug 1556789)
Backed out changeset 021d8cd8ba70 (bug 1556789)
2019-07-11 03:37:26 +03:00
Shane Caraveo
7a246d97fe Bug 1556789 - Refactor extension install in searchservice to use promises r=robwu,daleharvey
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
2019-07-10 22:47:02 +00:00
Victor Porof
1f830c96da Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36042

--HG--
extra : source : d3afcafdce650a6f36cebbc126ee93b17f13cf52
2019-07-05 09:53:32 +02:00
Andrew Swan
0e0b300fbe Bug 1549192 Fix extension apis that handle addon disabling r=kmag
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
2019-05-09 19:59:21 -07:00
Shane Caraveo
a0df3a4705 Bug 1541317 fix extension failures when setting homepage on upgrade r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D29912

--HG--
extra : moz-landing-system : lando
2019-05-08 01:30:25 +00:00
Dale Harvey
0b3e8675a7 Bug 1549122: Duct tape to prevent deadlock when search extensions upgraded on startup. r=mikedeboer a=Aryx
Differential Revision: https://phabricator.services.mozilla.com//D30004

--HG--
extra : rebase_source : 6637570bb828dfc86b1d0abfbafbd1cfdd12c9d8
extra : amend_source : 4803b6d8220d7d07a8a4f9562d4297090099a183
2019-05-06 13:06:34 +02:00
Shane Caraveo
a8aa66dce4 Bug 1544965 only remove search engines for an extension if the extension actually has one r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D29411

--HG--
extra : moz-landing-system : lando
2019-05-01 14:55:12 +00:00
Noemi Erli
9db98ad6c0 Backed out changeset f706ae697922 (bug 1541317) for failures in test_ext_settings_overrides_search.js 2019-04-27 02:01:58 +03:00
Shane Caraveo
2af6d30c83 Bug 1541317 support homepage setting on upgrade r=rpl,mkaply
Differential Revision: https://phabricator.services.mozilla.com/D28265

--HG--
extra : moz-landing-system : lando
2019-04-26 18:54:19 +00:00
Dale Harvey
7ebe97c465 Bug 1496075 - Part 1: Extensions changes to support search extensions. r=mixedpuppy,robwu
Differential Revision: https://phabricator.services.mozilla.com/D25244

--HG--
extra : moz-landing-system : lando
2019-04-11 21:30:47 +00:00
Shane Caraveo
7df3401a58 Bug 1532165 use prefs to support extension newtab and homepage on startup. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D25808

--HG--
extra : moz-landing-system : lando
2019-04-08 22:36:26 +00:00
Rob Wu
f55e72505d Bug 1525729 - Stop blocking extension startup on searchInitialized r=aswan
Depends on D23311

Differential Revision: https://phabricator.services.mozilla.com/D19701

--HG--
extra : moz-landing-system : lando
2019-03-13 18:48:57 +00:00
Andrew Swan
42db01a54d Bug 1534796 Tweak default search prompts r=mkaply
Differential Revision: https://phabricator.services.mozilla.com/D23227

--HG--
extra : rebase_source : 07c7a0c165f1067c3f970efe48b9eac4b3e32a8a
2019-03-12 14:32:24 -07:00
Narcis Beleuzu
682099b9bb Backed out changeset 52747743fe65 (bug 1525729) for XPCShell failures on test_ext_chrome_settings_overrides_update.js . CLOSED TREE
--HG--
extra : rebase_source : 1b62b48e4d2865a86f630d5fa6b615e9b84234c8
2019-02-28 22:59:55 +02:00