Loading browser/components/search/SearchUIUtils.sys.mjs +13 −4 Original line number Diff line number Diff line Loading @@ -93,8 +93,12 @@ export var SearchUIUtils = { * name of the engine to be moved and replaced. * @param {string} newEngine * name of the application default engine to replaced the removed engine. * @param {object} [details] * Additional details about the removed search engine. * @param {boolean} [details.removedMullvadLeta] * Whether we removed Mullvad Leta. */ async removalOfSearchEngineNotificationBox(oldEngine, newEngine) { async removalOfSearchEngineNotificationBox(oldEngine, newEngine, details) { let win = lazy.BrowserWindowTracker.getTopWindow({ allowFromInactiveWorkspace: true, }); Loading @@ -110,7 +114,12 @@ export var SearchUIUtils = { win.gNotificationBox.removeNotification(notificationBox); }, }, { details?.removedMullvadLeta ? { link: "https://leta.mullvad.net/mullvad-browser", "l10n-id": "moz-support-link-text", } : { supportPage: "search-engine-removal", }, ]; Loading toolkit/components/search/SearchService.sys.mjs +20 −4 Original line number Diff line number Diff line Loading @@ -1939,7 +1939,11 @@ export const SearchService = new (class SearchService { this._showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName || prevAppDefaultEngineName, newCurrentEngineName newCurrentEngineName, { removedMullvadLeta: (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta", } ); } } Loading Loading @@ -2017,7 +2021,13 @@ export const SearchService = new (class SearchService { // the user changes their locale it causes a change in engines. // If there is no update to settings metadata then the engine change was // caused by an update to config rather than a user changing their locale. if (!this.#didSettingsMetaDataUpdate(prevMetaData)) { // // For the removal of Mullvad Leta, we show the notification even if the // locale also changed because this change is not locale-dependant. if ( (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta" || !this.#didSettingsMetaDataUpdate(prevMetaData) ) { return true; } } Loading Loading @@ -3865,16 +3875,22 @@ export const SearchService = new (class SearchService { * The name of the previous default engine that will be replaced. * @param {string} newCurrentEngineName * The name of the engine that will be the new default engine. * @param {object} [details] * Additional details about the removed search engine. * @param {boolean} [details.removedMullvadLeta] * Whether we removed Mullvad Leta. */ _showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName, newCurrentEngineName newCurrentEngineName, details ) { lazy.BrowserUtils.callModulesFromCategory( { categoryName: "search-service-notification" }, "search-engine-removal", prevCurrentEngineName, newCurrentEngineName newCurrentEngineName, details ); } Loading Loading
browser/components/search/SearchUIUtils.sys.mjs +13 −4 Original line number Diff line number Diff line Loading @@ -93,8 +93,12 @@ export var SearchUIUtils = { * name of the engine to be moved and replaced. * @param {string} newEngine * name of the application default engine to replaced the removed engine. * @param {object} [details] * Additional details about the removed search engine. * @param {boolean} [details.removedMullvadLeta] * Whether we removed Mullvad Leta. */ async removalOfSearchEngineNotificationBox(oldEngine, newEngine) { async removalOfSearchEngineNotificationBox(oldEngine, newEngine, details) { let win = lazy.BrowserWindowTracker.getTopWindow({ allowFromInactiveWorkspace: true, }); Loading @@ -110,7 +114,12 @@ export var SearchUIUtils = { win.gNotificationBox.removeNotification(notificationBox); }, }, { details?.removedMullvadLeta ? { link: "https://leta.mullvad.net/mullvad-browser", "l10n-id": "moz-support-link-text", } : { supportPage: "search-engine-removal", }, ]; Loading
toolkit/components/search/SearchService.sys.mjs +20 −4 Original line number Diff line number Diff line Loading @@ -1939,7 +1939,11 @@ export const SearchService = new (class SearchService { this._showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName || prevAppDefaultEngineName, newCurrentEngineName newCurrentEngineName, { removedMullvadLeta: (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta", } ); } } Loading Loading @@ -2017,7 +2021,13 @@ export const SearchService = new (class SearchService { // the user changes their locale it causes a change in engines. // If there is no update to settings metadata then the engine change was // caused by an update to config rather than a user changing their locale. if (!this.#didSettingsMetaDataUpdate(prevMetaData)) { // // For the removal of Mullvad Leta, we show the notification even if the // locale also changed because this change is not locale-dependant. if ( (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta" || !this.#didSettingsMetaDataUpdate(prevMetaData) ) { return true; } } Loading Loading @@ -3865,16 +3875,22 @@ export const SearchService = new (class SearchService { * The name of the previous default engine that will be replaced. * @param {string} newCurrentEngineName * The name of the engine that will be the new default engine. * @param {object} [details] * Additional details about the removed search engine. * @param {boolean} [details.removedMullvadLeta] * Whether we removed Mullvad Leta. */ _showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName, newCurrentEngineName newCurrentEngineName, details ) { lazy.BrowserUtils.callModulesFromCategory( { categoryName: "search-service-notification" }, "search-engine-removal", prevCurrentEngineName, newCurrentEngineName newCurrentEngineName, details ); } Loading