
Pier Angelo Vendrame pushed to branch tor-browser-140.0a1-15.0-2 at The Tor Project / Applications / Tor Browser 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: - toolkit/components/search/AppProvidedSearchEngine.sys.mjs - toolkit/components/search/SearchEngine.sys.mjs - toolkit/components/search/content/torBrowserSearchEngineIcons.json Changes: ===================================== toolkit/components/search/AppProvidedSearchEngine.sys.mjs ===================================== @@ -134,29 +134,7 @@ class IconHandler { * source object or null of there is no icon with the supplied width. */ async createIconURL(iconRecord) { - let iconData; - try { - iconData = await this.#iconCollection.attachments.get(iconRecord); - } catch (ex) { - console.error(ex); - } - if (!iconData) { - console.warn("Unable to find the attachment for", iconRecord.id); - // Queue an update in case we haven't downloaded it yet. - this.#pendingUpdatesMap.set(iconRecord.id, iconRecord); - this.#maybeQueueIdle(); - return null; - } - - if (iconData.record.last_modified != iconRecord.last_modified) { - // The icon we have stored is out of date, queue an update so that we'll - // download the new icon. - this.#pendingUpdatesMap.set(iconRecord.id, iconRecord); - this.#maybeQueueIdle(); - } - return URL.createObjectURL( - new Blob([iconData.buffer], { type: iconRecord.attachment.mimetype }) - ); + return iconRecord.url; } QueryInterface = ChromeUtils.generateQI(["nsIObserver"]); @@ -242,11 +220,13 @@ class IconHandler { async #buildIconMap() { try { this.#iconMap = new Map( - await ( - await fetch( - "chrome://global/content/search/torBrowserSearchEngineIcons.json" - ) - ).json() + Object.entries( + await ( + await fetch( + "chrome://global/content/search/torBrowserSearchEngineIcons.json" + ) + ).json() + ) ); } catch (ex) { console.error(ex); ===================================== toolkit/components/search/SearchEngine.sys.mjs ===================================== @@ -14,7 +14,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { SearchSettings: "moz-src:///toolkit/components/search/SearchSettings.sys.mjs", SearchUtils: "moz-src:///toolkit/components/search/SearchUtils.sys.mjs", - SecurityLevelPrefs: "moz-src:///toolkit/modules/SecurityLevel.sys.mjs", + SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs", OpenSearchEngine: "moz-src:///toolkit/components/search/OpenSearchEngine.sys.mjs", }); ===================================== toolkit/components/search/content/torBrowserSearchEngineIcons.json ===================================== @@ -1,7 +1,32 @@ -[ - ["ddg", "chrome://global/content/search/duckduckgo.ico"], - ["ddg-onion", "chrome://global/content/search/duckduckgo.ico"], - ["startpage", "chrome://global/content/search/startpage.png"], - ["startpage-onion", "chrome://global/content/search/startpage.png"], - ["wikipedia", "chrome://global/content/search/wikipedia.ico"] -] +{ + "ddg": [ + { + "url": "chrome://global/content/search/duckduckgo.ico", + "imageSize": 16 + } + ], + "ddg-onion": [ + { + "url": "chrome://global/content/search/duckduckgo.ico", + "imageSize": 16 + } + ], + "startpage": [ + { + "url": "chrome://global/content/search/startpage.png", + "imageSize": 16 + } + ], + "startpage-onion": [ + { + "url": "chrome://global/content/search/startpage.png", + "imageSize": 16 + } + ], + "wikipedia": [ + { + "url": "chrome://global/content/search/wikipedia.ico", + "imageSize": 16 + } + ] +} View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/ac53eb6... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/ac53eb6... You're receiving this email because of your account on gitlab.torproject.org.