feat: add hostname substitution in user@host patterns

jsmith@macbook-pro now becomes ademo@mycomputer when both username
and hostname are configured in the Identity tab. Hostnames are also
caught standalone (e.g. just "macbook-pro" in text).

Also rewrites README with detailed step-by-step Mozilla API key
setup instructions for Firefox signing.

https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
Claude
2026-03-26 00:15:26 +00:00
parent 387b22530b
commit 34f1131c23
5 changed files with 139 additions and 29 deletions
+6 -1
View File
@@ -74,7 +74,12 @@
<span class="arrow">&rarr;</span>
<input type="text" id="idUserSub" placeholder="ademo" class="input input-sm">
</div>
<div class="id-hint">Catches: jsmith@hostname, /home/jsmith, ~jsmith, C:\Users\jsmith</div>
<div class="id-row">
<input type="text" id="idHostReal" placeholder="macbook-pro" class="input input-sm">
<span class="arrow">&rarr;</span>
<input type="text" id="idHostSub" placeholder="mycomputer" class="input input-sm">
</div>
<div class="id-hint">Catches: jsmith@macbook-pro, /home/jsmith, ~jsmith, C:\Users\jsmith</div>
</div>
<div class="id-section">
+13
View File
@@ -111,6 +111,11 @@ function loadIdentityForm() {
$('#idUserReal').value = user.real || '';
$('#idUserSub').value = user.substitute || '';
}
const host = (identity.hostnames || [])[0];
if (host) {
$('#idHostReal').value = host.real || '';
$('#idHostSub').value = host.substitute || '';
}
if (phone) {
$('#idPhoneReal').value = phone.real || '';
$('#idPhoneSub').value = phone.substitute || '';
@@ -144,6 +149,13 @@ async function saveIdentity() {
usernames.push({ real: userReal, substitute: userSub });
}
const hostnames = [];
const hostReal = $('#idHostReal').value.trim();
const hostSub = $('#idHostSub').value.trim();
if (hostReal && hostSub) {
hostnames.push({ real: hostReal, substitute: hostSub });
}
const phones = [];
const phoneReal = $('#idPhoneReal').value.trim();
const phoneSub = $('#idPhoneSub').value.trim();
@@ -155,6 +167,7 @@ async function saveIdentity() {
names,
emails,
usernames,
hostnames,
phones,
catchAllEmail: $('#idCatchAllEmail').value.trim(),
emailDomains: identity.emailDomains || [],