Fixed "Firefox" being shown instead of "Tor Browser" in the Security Level override option label.

This commit is contained in:
hackademix 2023-02-16 11:32:28 +01:00
parent 00f5905953
commit 5de9230cee
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 5 additions and 3 deletions

View File

@ -71,10 +71,12 @@ var UI = (() => {
debug = () => {}; // be quiet!
}
if (UI.local.isTorBrowser) {
let label = document.querySelector("span.tor");
const label = document.querySelector("span.tor");
if (label) {
label.textContent = label.textContent.replace(/\bTor Browser\b/g,
(await browser.runtime.getBrowserInfo()).name)
const browserName = (await browser.runtime.getBrowserInfo()).name;
if (browserName !== "Firefox") {
label.textContent = browserName;
}
}
document.documentElement.classList.add("tor");
Sites.onionSecure = true;