Commits:
-
61efd5f3
by Pier Angelo Vendrame at 2025-06-26T11:37:44+02:00
fixup! BB 40925: Implemented the Security Level component
Restore the resource:// URL for SecurityLevel.sys.mjs.
-
ba26fcb0
by Pier Angelo Vendrame at 2025-06-26T11:38:52+02:00
fixup! TB 42891: Set the bundled search engine for Tor Browser.
TB 43728: Update our custom icon fetching code.
Upstream added the possibility to have search engine icons in various
size, so we needed to update our code for getting search engines.
3 changed files:
Changes:
toolkit/components/search/AppProvidedSearchEngine.sys.mjs
| ... |
... |
@@ -134,29 +134,7 @@ class IconHandler { |
|
134
|
134
|
* source object or null of there is no icon with the supplied width.
|
|
135
|
135
|
*/
|
|
136
|
136
|
async createIconURL(iconRecord) {
|
|
137
|
|
- let iconData;
|
|
138
|
|
- try {
|
|
139
|
|
- iconData = await this.#iconCollection.attachments.get(iconRecord);
|
|
140
|
|
- } catch (ex) {
|
|
141
|
|
- console.error(ex);
|
|
142
|
|
- }
|
|
143
|
|
- if (!iconData) {
|
|
144
|
|
- console.warn("Unable to find the attachment for", iconRecord.id);
|
|
145
|
|
- // Queue an update in case we haven't downloaded it yet.
|
|
146
|
|
- this.#pendingUpdatesMap.set(iconRecord.id, iconRecord);
|
|
147
|
|
- this.#maybeQueueIdle();
|
|
148
|
|
- return null;
|
|
149
|
|
- }
|
|
150
|
|
-
|
|
151
|
|
- if (iconData.record.last_modified != iconRecord.last_modified) {
|
|
152
|
|
- // The icon we have stored is out of date, queue an update so that we'll
|
|
153
|
|
- // download the new icon.
|
|
154
|
|
- this.#pendingUpdatesMap.set(iconRecord.id, iconRecord);
|
|
155
|
|
- this.#maybeQueueIdle();
|
|
156
|
|
- }
|
|
157
|
|
- return URL.createObjectURL(
|
|
158
|
|
- new Blob([iconData.buffer], { type: iconRecord.attachment.mimetype })
|
|
159
|
|
- );
|
|
|
137
|
+ return iconRecord.url;
|
|
160
|
138
|
}
|
|
161
|
139
|
|
|
162
|
140
|
QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);
|
| ... |
... |
@@ -242,11 +220,13 @@ class IconHandler { |
|
242
|
220
|
async #buildIconMap() {
|
|
243
|
221
|
try {
|
|
244
|
222
|
this.#iconMap = new Map(
|
|
245
|
|
- await (
|
|
246
|
|
- await fetch(
|
|
247
|
|
- "chrome://global/content/search/torBrowserSearchEngineIcons.json"
|
|
248
|
|
- )
|
|
249
|
|
- ).json()
|
|
|
223
|
+ Object.entries(
|
|
|
224
|
+ await (
|
|
|
225
|
+ await fetch(
|
|
|
226
|
+ "chrome://global/content/search/torBrowserSearchEngineIcons.json"
|
|
|
227
|
+ )
|
|
|
228
|
+ ).json()
|
|
|
229
|
+ )
|
|
250
|
230
|
);
|
|
251
|
231
|
} catch (ex) {
|
|
252
|
232
|
console.error(ex);
|
toolkit/components/search/SearchEngine.sys.mjs
| ... |
... |
@@ -14,7 +14,7 @@ const lazy = {}; |
|
14
|
14
|
ChromeUtils.defineESModuleGetters(lazy, {
|
|
15
|
15
|
SearchSettings: "moz-src:///toolkit/components/search/SearchSettings.sys.mjs",
|
|
16
|
16
|
SearchUtils: "moz-src:///toolkit/components/search/SearchUtils.sys.mjs",
|
|
17
|
|
- SecurityLevelPrefs: "moz-src:///toolkit/modules/SecurityLevel.sys.mjs",
|
|
|
17
|
+ SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs",
|
|
18
|
18
|
OpenSearchEngine:
|
|
19
|
19
|
"moz-src:///toolkit/components/search/OpenSearchEngine.sys.mjs",
|
|
20
|
20
|
});
|
toolkit/components/search/content/torBrowserSearchEngineIcons.json
|
1
|
|
-[
|
|
2
|
|
- ["ddg", "chrome://global/content/search/duckduckgo.ico"],
|
|
3
|
|
- ["ddg-onion", "chrome://global/content/search/duckduckgo.ico"],
|
|
4
|
|
- ["startpage", "chrome://global/content/search/startpage.png"],
|
|
5
|
|
- ["startpage-onion", "chrome://global/content/search/startpage.png"],
|
|
6
|
|
- ["wikipedia", "chrome://global/content/search/wikipedia.ico"]
|
|
7
|
|
-] |
|
|
1
|
+{
|
|
|
2
|
+ "ddg": [
|
|
|
3
|
+ {
|
|
|
4
|
+ "url": "chrome://global/content/search/duckduckgo.ico",
|
|
|
5
|
+ "imageSize": 16
|
|
|
6
|
+ }
|
|
|
7
|
+ ],
|
|
|
8
|
+ "ddg-onion": [
|
|
|
9
|
+ {
|
|
|
10
|
+ "url": "chrome://global/content/search/duckduckgo.ico",
|
|
|
11
|
+ "imageSize": 16
|
|
|
12
|
+ }
|
|
|
13
|
+ ],
|
|
|
14
|
+ "startpage": [
|
|
|
15
|
+ {
|
|
|
16
|
+ "url": "chrome://global/content/search/startpage.png",
|
|
|
17
|
+ "imageSize": 16
|
|
|
18
|
+ }
|
|
|
19
|
+ ],
|
|
|
20
|
+ "startpage-onion": [
|
|
|
21
|
+ {
|
|
|
22
|
+ "url": "chrome://global/content/search/startpage.png",
|
|
|
23
|
+ "imageSize": 16
|
|
|
24
|
+ }
|
|
|
25
|
+ ],
|
|
|
26
|
+ "wikipedia": [
|
|
|
27
|
+ {
|
|
|
28
|
+ "url": "chrome://global/content/search/wikipedia.ico",
|
|
|
29
|
+ "imageSize": 16
|
|
|
30
|
+ }
|
|
|
31
|
+ ]
|
|
|
32
|
+} |
|