Fix for outputting search removal notice banner

Broke during the i18n migration
pull/765/head
Kevin Payravi 2024-07-19 01:23:01 -07:00
parent e34b1ce5d5
commit e1096825c5
1 changed files with 10 additions and 4 deletions

View File

@ -118,10 +118,16 @@ function hideSearchResults(searchResultContainer, searchEngine, site, showBanner
let searchRemovalNoticeLink = document.createElement('a');
searchRemovalNoticeLink.href = 'https://' + site.destination_base_url;
searchRemovalNoticeLink.textContent = site.destination;
searchRemovalNotice.appendChild(extensionAPI.i18n.getMessage('searchRemovalNotice', [
site.origin + site.language !== 'EN' ? ' (' + site.language + ')' : '',
searchRemovalNoticeLink.outerHTML
]));
searchRemovalNoticeText = extensionAPI.i18n.getMessage('searchRemovalNotice', [
site.origin + (site.language !== 'EN' ? ' (' + site.language + ')' : ''),
'LINK_PLACEHOLDER'
]);
const searchRemovalNoticeTextParts = searchRemovalNoticeText.split('LINK_PLACEHOLDER');
const searchRemovalNoticeFragment = document.createDocumentFragment();
searchRemovalNoticeFragment.appendChild(document.createTextNode(searchRemovalNoticeTextParts[0]));
searchRemovalNoticeFragment.appendChild(searchRemovalNoticeLink);
searchRemovalNoticeFragment.appendChild(document.createTextNode(searchRemovalNoticeTextParts[1]));
searchRemovalNotice.appendChild(searchRemovalNoticeFragment);
// Output container for result controls:
let resultControls = document.createElement('div');