SUpport for protocol-only entries in UI.
This commit is contained in:
parent
16d1b03062
commit
050aa8b83b
11
src/ui/ui.js
11
src/ui/ui.js
|
@ -590,16 +590,21 @@ var UI = (() => {
|
|||
try {
|
||||
url = new URL(site);
|
||||
} catch (e) {
|
||||
if (/^(\w+:)\/*$/.test(site)) {
|
||||
url = {protocol: RegExp.$1, hostname: "", origin: site, pathname:""};
|
||||
let hostname = Sites.toExternal(url.hostname);
|
||||
debug("Lonely %o", url, Sites.isSecureDomainKey(siteMatch) || !hostname && url.protocol === "https:");
|
||||
} else {
|
||||
let protocol = Sites.isSecureDomainKey(site) ? "https:" : "http:";
|
||||
let hostname = Sites.toggleSecureDomainKey(site, false);
|
||||
url = {protocol, hostname, origin: `${protocol}://${site}`, pathname: "/"};
|
||||
}
|
||||
}
|
||||
|
||||
let hostname = Sites.toExternal(url.hostname);
|
||||
let domain = tld.getDomain(hostname);
|
||||
|
||||
if (!siteMatch) {
|
||||
// siteMatch = url.protocol === "https:" ? Sites.secureDomainKey(domain) : site;
|
||||
siteMatch = site;
|
||||
}
|
||||
let secure = Sites.isSecureDomainKey(siteMatch);
|
||||
|
@ -628,12 +633,12 @@ var UI = (() => {
|
|||
|
||||
row.querySelector(".domain").textContent = domain;
|
||||
row.querySelector(".path").textContent = siteMatch.length > url.origin.length ? url.pathname : "";
|
||||
let httpsOnly = row.querySelector("input.https-only");
|
||||
httpsOnly.checked = keyStyle === "full" || keyStyle === "secure";
|
||||
} else {
|
||||
row._label = siteMatch;
|
||||
urlContainer.querySelector(".full-address").textContent = siteMatch;
|
||||
}
|
||||
let httpsOnly = row.querySelector("input.https-only");
|
||||
httpsOnly.checked = keyStyle === "full" || keyStyle === "secure";
|
||||
|
||||
let presets = row.querySelectorAll("input.preset");
|
||||
let idSuffix = `-${this.uiCount}-${sitesCount}`;
|
||||
|
|
Loading…
Reference in New Issue