explicitly hyphenate domains in popup

This commit is contained in:
tophf 2022-02-21 02:36:03 +03:00
parent 6ff68aaa74
commit e0c9c13856
2 changed files with 2 additions and 6 deletions

View File

@ -465,10 +465,6 @@ a:hover .svg-icon {
margin-left: .6ex
}
.write-style-link::before {
content: "\00ad"; /* "soft" hyphen */
}
.about-blank > .breadcrumbs {
pointer-events: none;
}

View File

@ -202,7 +202,7 @@ function createWriterElement(frame) {
title: `url-prefix("${url}")`,
tabIndex: isAboutBlank ? -1 : 0,
textContent: prefs.get('popup.breadcrumbs.usePath')
? new URL(url).pathname.slice(1)
? t.breakWord(new URL(url).pathname.slice(1))
: frameId
? isAboutBlank ? url : 'URL'
: t('writeStyleForURL').replace(/ /g, '\u00a0'), // this URL
@ -227,7 +227,7 @@ function createWriterElement(frame) {
const domainLink = t.template.writeStyle.cloneNode(true);
Object.assign(domainLink, {
href: 'edit.html?domain=' + encodeURIComponent(domain),
textContent: numParts > 2 ? domain.split('.')[0] : domain,
textContent: t.breakWord(numParts > 2 ? domain.split('.')[0] : domain),
title: `domain("${domain}")`,
onclick: e => Events.openEditor(e, {domain}),
});