Loading browser/components/search/SearchUIUtils.sys.mjs +13 −4 Original line number Diff line number Diff line Loading @@ -76,8 +76,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(); let buttons = [ Loading @@ -91,7 +95,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 @@ -1811,7 +1811,11 @@ export class SearchService { this._showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName || prevAppDefaultEngineName, newCurrentEngineName newCurrentEngineName, { removedMullvadLeta: (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta", } ); } } Loading Loading @@ -1889,7 +1893,13 @@ export 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 @@ -3728,16 +3738,22 @@ export 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 @@ -76,8 +76,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(); let buttons = [ Loading @@ -91,7 +95,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 @@ -1811,7 +1811,11 @@ export class SearchService { this._showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName || prevAppDefaultEngineName, newCurrentEngineName newCurrentEngineName, { removedMullvadLeta: (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta", } ); } } Loading Loading @@ -1889,7 +1893,13 @@ export 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 @@ -3728,16 +3738,22 @@ export 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