fix: support (99+) style notification badges in tab title normalization

This commit is contained in:
Timo
2026-07-12 17:29:33 +02:00
parent 9e8a446d97
commit cc96fc1771
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export function normalizeSendTabTitle(sendTabTitle, legacyMode = TITLE_PRIVACY_M
export function normalizeTabTitle(title) {
if (typeof title !== 'string') return null;
const normalized = title.replace(/^\s*(?:\(\d{1,2}\)|\[\d{1,2}\])\s+/, '').trim();
const normalized = title.replace(/^\s*(?:\(\d{1,2}\+?\)|\[\d{1,2}\+?\])\s+/, '').trim();
return normalized.length > 0 ? normalized : null;
}
+1
View File
@@ -18,6 +18,7 @@ assert.equal(normalizeSendTabTitle(true, TITLE_PRIVACY_MODES.HIDDEN), true);
assert.equal(normalizeSendTabTitle(false, TITLE_PRIVACY_MODES.FULL), false);
assert.equal(normalizeTabTitle('(12) Testvideo - YouTube'), 'Testvideo - YouTube');
assert.equal(normalizeTabTitle('[7] Testvideo - YouTube'), 'Testvideo - YouTube');
assert.equal(normalizeTabTitle('(99+) Testvideo - YouTube'), 'Testvideo - YouTube');
assert.equal(normalizeTabTitle('(500) Days of Summer'), '(500) Days of Summer');
assert.equal(normalizeTabTitle(' '), null);