[Tor] Display .onion sites as "secure" in the UI (tickets #27313 and #27307).

This commit is contained in:
hackademix 2019-10-09 14:49:28 +02:00
parent a0343e16c2
commit 98269dc4b0
1 changed files with 3 additions and 2 deletions

View File

@ -631,10 +631,11 @@ var UI = (() => {
siteMatch = site;
}
let secure = Sites.isSecureDomainKey(siteMatch);
let isOnion = UI.local.isTorBrowser && hostname && hostname.endsWith(".onion");
let keyStyle = secure ? "secure"
: !domain || /^\w+:/.test(siteMatch) ?
(url.protocol === "https:" ? "full" : "unsafe")
: domain === hostname ? "domain" : "host";
(url.protocol === "https:" || isOnion ? "full" : "unsafe")
: isOnion ? "secure" : domain === hostname ? "domain" : "host";
let urlContainer = row.querySelector(".url");
urlContainer.dataset.key = keyStyle;