Commits:
-
6365e59b
by Henry Wilkes at 2025-11-19T15:23:24+00:00
fixup! MB 213: Customize the search engines list.
MB 488: Drop Mullvad Leta search engine.
-
c8f095e2
by Henry Wilkes at 2025-11-19T15:23:25+00:00
MB 488: Adjust search engine removal notification for Mullvad Leta.
6 changed files:
Changes:
browser/components/search/SearchUIUtils.sys.mjs
| ... |
... |
@@ -76,8 +76,12 @@ export var SearchUIUtils = { |
|
76
|
76
|
* name of the engine to be moved and replaced.
|
|
77
|
77
|
* @param {string} newEngine
|
|
78
|
78
|
* name of the application default engine to replaced the removed engine.
|
|
|
79
|
+ * @param {object} [details]
|
|
|
80
|
+ * Additional details about the removed search engine.
|
|
|
81
|
+ * @param {boolean} [details.removedMullvadLeta]
|
|
|
82
|
+ * Whether we removed Mullvad Leta.
|
|
79
|
83
|
*/
|
|
80
|
|
- async removalOfSearchEngineNotificationBox(oldEngine, newEngine) {
|
|
|
84
|
+ async removalOfSearchEngineNotificationBox(oldEngine, newEngine, details) {
|
|
81
|
85
|
let win = lazy.BrowserWindowTracker.getTopWindow();
|
|
82
|
86
|
|
|
83
|
87
|
let buttons = [
|
| ... |
... |
@@ -91,9 +95,14 @@ export var SearchUIUtils = { |
|
91
|
95
|
win.gNotificationBox.removeNotification(notificationBox);
|
|
92
|
96
|
},
|
|
93
|
97
|
},
|
|
94
|
|
- {
|
|
95
|
|
- supportPage: "search-engine-removal",
|
|
96
|
|
- },
|
|
|
98
|
+ details?.removedMullvadLeta
|
|
|
99
|
+ ? {
|
|
|
100
|
+ link: "https://leta.mullvad.net/mullvad-browser",
|
|
|
101
|
+ "l10n-id": "moz-support-link-text",
|
|
|
102
|
+ }
|
|
|
103
|
+ : {
|
|
|
104
|
+ supportPage: "search-engine-removal",
|
|
|
105
|
+ },
|
|
97
|
106
|
];
|
|
98
|
107
|
|
|
99
|
108
|
await win.gNotificationBox.appendNotification(
|
toolkit/components/search/SearchService.sys.mjs
| ... |
... |
@@ -1811,7 +1811,11 @@ export class SearchService { |
|
1811
|
1811
|
|
|
1812
|
1812
|
this._showRemovalOfSearchEngineNotificationBox(
|
|
1813
|
1813
|
prevCurrentEngineName || prevAppDefaultEngineName,
|
|
1814
|
|
- newCurrentEngineName
|
|
|
1814
|
+ newCurrentEngineName,
|
|
|
1815
|
+ {
|
|
|
1816
|
+ removedMullvadLeta:
|
|
|
1817
|
+ (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta",
|
|
|
1818
|
+ }
|
|
1815
|
1819
|
);
|
|
1816
|
1820
|
}
|
|
1817
|
1821
|
}
|
| ... |
... |
@@ -1889,7 +1893,13 @@ export class SearchService { |
|
1889
|
1893
|
// the user changes their locale it causes a change in engines.
|
|
1890
|
1894
|
// If there is no update to settings metadata then the engine change was
|
|
1891
|
1895
|
// caused by an update to config rather than a user changing their locale.
|
|
1892
|
|
- if (!this.#didSettingsMetaDataUpdate(prevMetaData)) {
|
|
|
1896
|
+ //
|
|
|
1897
|
+ // For the removal of Mullvad Leta, we show the notification even if the
|
|
|
1898
|
+ // locale also changed because this change is not locale-dependant.
|
|
|
1899
|
+ if (
|
|
|
1900
|
+ (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta" ||
|
|
|
1901
|
+ !this.#didSettingsMetaDataUpdate(prevMetaData)
|
|
|
1902
|
+ ) {
|
|
1893
|
1903
|
return true;
|
|
1894
|
1904
|
}
|
|
1895
|
1905
|
}
|
| ... |
... |
@@ -3728,16 +3738,22 @@ export class SearchService { |
|
3728
|
3738
|
* The name of the previous default engine that will be replaced.
|
|
3729
|
3739
|
* @param {string} newCurrentEngineName
|
|
3730
|
3740
|
* The name of the engine that will be the new default engine.
|
|
|
3741
|
+ * @param {object} [details]
|
|
|
3742
|
+ * Additional details about the removed search engine.
|
|
|
3743
|
+ * @param {boolean} [details.removedMullvadLeta]
|
|
|
3744
|
+ * Whether we removed Mullvad Leta.
|
|
3731
|
3745
|
*/
|
|
3732
|
3746
|
_showRemovalOfSearchEngineNotificationBox(
|
|
3733
|
3747
|
prevCurrentEngineName,
|
|
3734
|
|
- newCurrentEngineName
|
|
|
3748
|
+ newCurrentEngineName,
|
|
|
3749
|
+ details
|
|
3735
|
3750
|
) {
|
|
3736
|
3751
|
lazy.BrowserUtils.callModulesFromCategory(
|
|
3737
|
3752
|
{ categoryName: "search-service-notification" },
|
|
3738
|
3753
|
"search-engine-removal",
|
|
3739
|
3754
|
prevCurrentEngineName,
|
|
3740
|
|
- newCurrentEngineName
|
|
|
3755
|
+ newCurrentEngineName,
|
|
|
3756
|
+ details
|
|
3741
|
3757
|
);
|
|
3742
|
3758
|
}
|
|
3743
|
3759
|
|
toolkit/components/search/content/base-browser-search-engine-icons.json
|
1
|
1
|
{
|
|
2
|
|
- "mullvad-leta": [
|
|
3
|
|
- {
|
|
4
|
|
- "url": "chrome://global/content/search/mullvad-leta.svg",
|
|
5
|
|
- "imageSize": 16
|
|
6
|
|
- }
|
|
7
|
|
- ],
|
|
8
|
2
|
"ddg": [
|
|
9
|
3
|
{ "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
|
|
10
|
4
|
],
|
toolkit/components/search/content/base-browser-search-engines.json
|
1
|
1
|
[
|
|
2
|
|
- {
|
|
3
|
|
- "base": {
|
|
4
|
|
- "aliases": ["mullvad-leta", "leta", "mullvad", "ml"],
|
|
5
|
|
- "classification": "general",
|
|
6
|
|
- "name": "Mullvad Leta",
|
|
7
|
|
- "urls": {
|
|
8
|
|
- "search": {
|
|
9
|
|
- "base": "https://leta.mullvad.net/",
|
|
10
|
|
- "params": [],
|
|
11
|
|
- "searchTermParamName": "q"
|
|
12
|
|
- }
|
|
13
|
|
- }
|
|
14
|
|
- },
|
|
15
|
|
- "id": "ee88d691-6d7a-4adb-9fec-5a205565505a",
|
|
16
|
|
- "identifier": "mullvad-leta",
|
|
17
|
|
- "recordType": "engine",
|
|
18
|
|
- "variants": [{ "environment": { "allRegionsAndLocales": true } }]
|
|
19
|
|
- },
|
|
20
|
2
|
{
|
|
21
|
3
|
"base": {
|
|
22
|
4
|
"aliases": ["duckduckgo", "ddg"],
|
| ... |
... |
@@ -127,23 +109,15 @@ |
|
127
|
109
|
},
|
|
128
|
110
|
{
|
|
129
|
111
|
"recordType": "defaultEngines",
|
|
130
|
|
- "globalDefault": "mullvad-leta",
|
|
131
|
|
- "globalDefaultPrivate": "mullvad-leta"
|
|
|
112
|
+ "globalDefault": "ddg",
|
|
|
113
|
+ "globalDefaultPrivate": "dgg"
|
|
132
|
114
|
},
|
|
133
|
115
|
{
|
|
134
|
116
|
"recordType": "engineOrders",
|
|
135
|
117
|
"orders": [
|
|
136
|
118
|
{
|
|
137
|
119
|
"environment": { "allRegionsAndLocales": true },
|
|
138
|
|
- "order": [
|
|
139
|
|
- "mullvad-leta",
|
|
140
|
|
- "ddg",
|
|
141
|
|
- "ddg-html",
|
|
142
|
|
- "ddg-noai",
|
|
143
|
|
- "mojeek",
|
|
144
|
|
- "brave",
|
|
145
|
|
- "startpage"
|
|
146
|
|
- ]
|
|
|
120
|
+ "order": ["ddg", "ddg-html", "ddg-noai", "mojeek", "brave", "startpage"]
|
|
147
|
121
|
}
|
|
148
|
122
|
]
|
|
149
|
123
|
}
|
toolkit/components/search/content/mullvad-leta.svg
deleted
|
1
|
|
-<svg xmlns="http://www.w3.org/2000/svg" id="Mullvad_VPN_Logo_Positive" x="0" y="0" version="1.1"
|
|
2
|
|
- viewBox="0 0 252.70001 252.6" xml:space="preserve">
|
|
3
|
|
- <g id="Logo" transform="translate(-566.2 -73.7)">
|
|
4
|
|
- <path id="bg" fill="#192e45" fill-rule="evenodd"
|
|
5
|
|
- d="M566.2 200c0 69.8 56.6 126.3 126.3 126.3 69.7 0 126.4-56.5 126.4-126.3S762.3 73.7 692.5 73.7c-69.8 0-126.3 56.5-126.3 126.3z"
|
|
6
|
|
- clip-rule="evenodd" />
|
|
7
|
|
- <path id="Mullvad_Fur" fill="#d0933a" fill-rule="evenodd"
|
|
8
|
|
- d="M583.1 184.9l9.6-13.4c0 .1-.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.6-10.4 12.5c-.7-.2-.9-.6-.9-.6l.7-15.4-3.3 13.9c-1-.5-2.2-.7-3.4-.7-4.6 0-8.3 3.7-8.3 8.3 0 4.2 3.1 7.7 7.2 8.2l-7.1 14.4z"
|
|
9
|
|
- clip-rule="evenodd" />
|
|
10
|
|
- <path id="Mullvad_Nose" fill="#ffcc86" fill-rule="evenodd"
|
|
11
|
|
- d="M594.8 154.5c-1-.4-2.2-.7-3.3-.7-4.6 0-8.3 3.7-8.3 8.3 0 4 2.9 7.4 6.7 8.2h.2c2.5-.8 7.5-7.5 6.7-11.7-.4-1.5-1-2.9-2-4.1z"
|
|
12
|
|
- clip-rule="evenodd" />
|
|
13
|
|
- <path id="Mullvad_Helmet" fill="#fdd321" fill-rule="evenodd"
|
|
14
|
|
- d="M667.6 143.8c-1.5-4.1-1.1-9.4 1-14.4 3-6.9 8.7-11.5 14.1-11.5 1.1 0 2.1.2 3.1.6 3.1-2.8 6.7-5.1 10.7-6.7 22.1-8.8 54.4 6.9 62.7 28.6 4 10.5 2.8 22-.6 32.5-2.8 8.6-13 21-9.2 30.4-1.5-.4-33.1-10.2-41.9-15.8-14.1-8.8-26.8-19.6-36.3-28l-.3-.3-32.1-15.2c-.4-.2-.8-.4-1.1-.6 4.6 0 22.1 2.1 29.9.4"
|
|
15
|
|
- clip-rule="evenodd" />
|
|
16
|
|
- <g id="Helmet_Lamp">
|
|
17
|
|
- <path id="path113" fill="#fff"
|
|
18
|
|
- d="M677.1 147.4c-.9 0-1.6-.2-2.3-.5-1.6-.7-2.8-2-3.6-4-1.4-3.4-1-8.1.9-12.5 2.5-5.6 7.3-9.7 11.5-9.7.8 0 1.6.2 2.4.5 2.1.9 3.6 3 4.1 6 .6 3.2.1 6.9-1.5 10.4-2.4 5.7-7.3 9.8-11.5 9.8z" />
|
|
19
|
|
- <g id="g117">
|
|
20
|
|
- <path id="path115" fill="#1d2a3a"
|
|
21
|
|
- d="M683.6 122.3c.6 0 1.2.1 1.8.4 1.6.7 2.8 2.5 3.2 4.9.5 2.9.1 6.3-1.4 9.5-2.2 5.1-6.5 8.8-10.1 8.8-.6 0-1.2-.1-1.7-.3-1.5-.6-2.3-2-2.7-3.1-1.2-3-.9-7.4.8-11.4 2.2-5.1 6.5-8.8 10.1-8.8m0-3c-4.8 0-10.1 4.4-12.9 10.7-2.1 4.7-2.4 9.8-.9 13.7.9 2.3 2.4 3.9 4.3 4.8.9.4 1.9.6 3 .6 4.8 0 10.1-4.4 12.8-10.7 1.7-3.8 2.2-7.8 1.6-11.3-.6-3.5-2.4-6-5-7.1-.9-.5-1.9-.7-2.9-.7z" />
|
|
22
|
|
- </g>
|
|
23
|
|
- </g>
|
|
24
|
|
- </g>
|
|
25
|
|
-</svg> |
toolkit/components/search/tests/xpcshell/test_base_browser.js
| ... |
... |
@@ -11,7 +11,6 @@ |
|
11
|
11
|
"use strict";
|
|
12
|
12
|
|
|
13
|
13
|
const expectedURLs = {
|
|
14
|
|
- "mullvad-leta": "https://leta.mullvad.net/?q=test",
|
|
15
|
14
|
ddg: "https://duckduckgo.com/?q=test",
|
|
16
|
15
|
"ddg-html": "https://html.duckduckgo.com/html/?q=test",
|
|
17
|
16
|
"ddg-noai": "https://noai.duckduckgo.com/?q=test",
|
| ... |
... |
@@ -19,7 +18,7 @@ const expectedURLs = { |
|
19
|
18
|
brave: "https://search.brave.com/search?q=test",
|
|
20
|
19
|
startpage: "https://www.startpage.com/sp/search?q=test",
|
|
21
|
20
|
};
|
|
22
|
|
-const defaultEngine = "mullvad-leta";
|
|
|
21
|
+const defaultEngine = "ddg";
|
|
23
|
22
|
|
|
24
|
23
|
add_setup(async function setup() {
|
|
25
|
24
|
await Services.search.init();
|
|