Bug 1804829 - Avoid last use of location.hostname on about:neterror page. r=prathiksha

It looks like hostname is sometimes undefined, which triggers a Fluent error.
The HOST_NAME is determined from location.href,
and falls back to an empty string value about which Fluent is much happier.

Differential Revision: https://phabricator.services.mozilla.com/D164538
This commit is contained in:
Eemeli Aro 2022-12-19 10:05:16 +00:00
Родитель 4db1f81ea9
Коммит 146a3e1023
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -308,7 +308,7 @@ function initPage() {
document.getElementById("errorShortDesc").hidden = true;
document.l10n.setAttributes(longDesc, "csp-xfo-blocked-long-desc", {
hostname: document.location.hostname ?? "", // FIXME - should this be HOST_NAME?
hostname: HOST_NAME,
});
longDesc = null;