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:
@@ -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
@@ -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
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p>Silent Send v2.0.3</p>
|
||||
<p>Silent Send v2.0.5</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user