fix: disable proper noun detection by default (too many false positives)
Proper noun detection (flagging capitalized phrases like "Getting Started", "Generate Design", "Introduction Getting Started") now disabled by default. Enable via popup → Options tab → Detect proper nouns. The pattern-based detection (IPs, emails, API keys, addresses, paths, etc.) remains always-on and reliable. The capitalized phrase heuristic was producing too many false positives on normal UI phrases, headings, and instructions — adding words to the filter was a losing game. Added detectProperNouns toggle to popup Options tab. Updated README to note it's opt-in. https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
@@ -67,17 +67,13 @@ A browser extension (Chrome, Firefox, and Safari) that intercepts personal infor
|
||||
| `123-45-6789` | `[REDACTED-SSN]` |
|
||||
| `4111 1111 1111 1111` | `[REDACTED-CARD]` |
|
||||
|
||||
### Proper noun detection (automatic)
|
||||
### Proper noun detection (opt-in)
|
||||
|
||||
The auto-detect scanner also catches capitalized words mid-sentence that might be names, company names, or project names you forgot to configure. For example:
|
||||
The auto-detect scanner can optionally flag capitalized phrases that might be names, company names, or project names you forgot to configure. **Disabled by default** because it can produce false positives on normal phrases like "Getting Started" or "Generate Design".
|
||||
|
||||
| You type | What happens |
|
||||
|----------|-------------|
|
||||
| `...talked to Sarah about the deploy` | Flags "Sarah" as a possible name |
|
||||
| `...the Acme Corp internal API` | Flags "Acme Corp" as a possible organization |
|
||||
| `...pushed to Project Atlas staging` | Flags "Project Atlas" as a possible project name |
|
||||
Enable it in the popup → Options tab → **Detect proper nouns**.
|
||||
|
||||
These are flagged as warnings (not auto-redacted) so you can decide whether to add them as mappings. Common English words, programming terms, days, and months are excluded to reduce false positives.
|
||||
When enabled, phrases like "Acme Corp" or "Project Atlas" will be flagged as warnings so you can decide whether to add them as mappings. You can click "ignore" on any false positive to permanently dismiss it.
|
||||
|
||||
### Bulk import (speed up setup)
|
||||
|
||||
|
||||
@@ -604,9 +604,11 @@
|
||||
}
|
||||
|
||||
// Proper noun heuristic — catch names, company names, project names
|
||||
// that aren't configured in identity
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
// Disabled by default (too many false positives). Enable in Options.
|
||||
if (settings.detectProperNouns) {
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
}
|
||||
|
||||
// Deduplicate by value
|
||||
const seen = new Set();
|
||||
|
||||
@@ -136,7 +136,7 @@ const AutoDetect = {
|
||||
*
|
||||
* Returns array of { name, value, hint, category, index }
|
||||
*/
|
||||
scan(text, identity) {
|
||||
scan(text, identity, options) {
|
||||
if (!text || text.length < 5) return [];
|
||||
|
||||
const hasContext = CONTEXT_WORDS.test(text);
|
||||
@@ -194,8 +194,11 @@ const AutoDetect = {
|
||||
}
|
||||
|
||||
// Proper noun heuristic — catch names, company names, project names
|
||||
const properNouns = this._detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
// Disabled by default (too many false positives). Pass detectProperNouns: true to enable.
|
||||
if (options?.detectProperNouns) {
|
||||
const properNouns = this._detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
}
|
||||
|
||||
// Deduplicate overlapping matches
|
||||
findings.sort((a, b) => (a.index || 0) - (b.index || 0));
|
||||
|
||||
@@ -236,6 +236,14 @@
|
||||
<label class="toggle"><input type="checkbox" id="optDocPreview" checked><span class="toggle-slider"></span></label>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-label">
|
||||
<strong>Detect proper nouns</strong>
|
||||
<span class="setting-desc">Flag capitalized phrases (names, companies) — may produce false positives</span>
|
||||
</div>
|
||||
<label class="toggle"><input type="checkbox" id="optProperNouns"><span class="toggle-slider"></span></label>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb">
|
||||
<button class="btn" id="btnOpenFullOptions" style="width:100%;font-size:12px">Open Full Options Page</button>
|
||||
<p class="help-text" style="margin-top:6px;text-align:center">Sync, encryption, org, version history, import/export, and more</p>
|
||||
|
||||
@@ -225,6 +225,7 @@ async function initUnlockedUI() {
|
||||
$('#optAutoRedact').checked = settings.autoRedactDetected !== false;
|
||||
$('#optHighlights').checked = settings.showHighlights || false;
|
||||
$('#optDocPreview').checked = settings.docScanPreview !== false;
|
||||
$('#optProperNouns').checked = settings.detectProperNouns || false;
|
||||
|
||||
// Options tab change handlers
|
||||
const optHandlers = [
|
||||
@@ -233,6 +234,7 @@ async function initUnlockedUI() {
|
||||
['optAutoRedact', 'autoRedactDetected'],
|
||||
['optHighlights', 'showHighlights'],
|
||||
['optDocPreview', 'docScanPreview'],
|
||||
['optProperNouns', 'detectProperNouns'],
|
||||
];
|
||||
for (const [id, key] of optHandlers) {
|
||||
$(`#${id}`).addEventListener('change', async (e) => {
|
||||
|
||||
Reference in New Issue
Block a user