fix: catch concatenated name forms (JohnSmith, john.smith, etc.)

Smart patterns now catch all concatenated combinations of first+last
names with common separators:

| Pattern | Example real | Example replaced |
|---------|-------------|-----------------|
| FirstLast | JohnSmith | AdemoDem |
| firstlast | johnsmith | ademodemo |
| first.last | john.smith | ademo.demo |
| first_last | john_smith | ademo_demo |
| first-last | john-smith | ademo-demo |
| LastFirst | SmithJohn | DemoAdemo |
| last.first | smith.john | demo.ademo |

Case is preserved: all-lowercase input → lowercase output,
ALL-UPPERCASE → uppercase, mixed case → as configured.

Also bumped all versions to 2.0.5.

https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
Claude
2026-03-27 03:16:56 +00:00
parent 04372ab561
commit e739531cee
5 changed files with 30 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Silent Send",
"version": "2.0.3",
"version": "2.0.5",
"description": "Intercepts personal info and substitutes it with user-defined replacements before sending to AI services.",
"browser_specific_settings": {
"gecko": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Silent Send",
"version": "2.0.3",
"version": "2.0.5",
"description": "Intercepts personal info and substitutes it with user-defined replacements before sending to AI services.",
"permissions": [
"storage",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "silent-send",
"version": "2.0.3",
"version": "2.0.5",
"private": true,
"license": "BSL-1.1",
"description": "Browser extension that substitutes personal data before sending to AI services",
+26
View File
@@ -182,6 +182,32 @@
replacements.push({ original: matched, replaced: sub, category: 'name', pattern: 'smart' });
return sub;
});
// Concatenated forms: JohnSmith, johnsmith, john.smith, john_smith, john-smith
// Also reversed: SmithJohn, smithjohn, smith.john, etc.
const f = first.real, l = last.real;
const fs = first.substitute, ls = last.substitute;
const concatPatterns = [
// first+last
[f + l, fs + ls],
[f + '.' + l, fs + '.' + ls],
[f + '_' + l, fs + '_' + ls],
[f + '-' + l, fs + '-' + ls],
// last+first
[l + f, ls + fs],
[l + '.' + f, ls + '.' + fs],
[l + '_' + f, ls + '_' + fs],
[l + '-' + f, ls + '-' + fs],
];
for (const [real, sub] of concatPatterns) {
result = result.replace(new RegExp('\\b' + esc(real) + '\\b', 'gi'), (matched) => {
// Preserve case: all-lower→lower, ALL-UPPER→upper, else use sub as-is
let replacement = sub;
if (matched === matched.toLowerCase()) replacement = sub.toLowerCase();
else if (matched === matched.toUpperCase()) replacement = sub.toUpperCase();
replacements.push({ original: matched, replaced: replacement, category: 'name', pattern: 'smart-concat' });
return replacement;
});
}
}
}
+1 -1
View File
@@ -589,7 +589,7 @@
</section>
<footer>
<p>Silent Send v2.0.3</p>
<p>Silent Send v2.0.5</p>
</footer>
</div>