Fix PDF decompression, add proper noun detection toggle, bump to 0.9.25
- document-scanner.js: Add missing await on _inflateSync() call — FlateDecode streams were not being decompressed because the async function was called without await, causing decompressed to hold a Promise instead of data - content.js, storage.js, options.html, options.js: Gate proper noun / capital letter detection behind a new detectProperNouns setting (default off); was previously always-on causing noisy false-positive warnings on AI thinking output and common capitalized words - Bump version 0.9.23 → 0.9.25 https://claude.ai/code/session_01ReZUeR1nrYzJeX7fTqwXMw
This commit is contained in:
@@ -278,7 +278,7 @@
|
||||
// 4. Auto-detect: scan the FINAL text for unconfigured PII
|
||||
// Auto-redact if enabled, otherwise just warn
|
||||
if (settings.autoDetect !== false) {
|
||||
const warnings = autoDetectPII(finalText, identity);
|
||||
const warnings = autoDetectPII(finalText, identity, { detectProperNouns: settings.detectProperNouns === true });
|
||||
if (warnings.length > 0) {
|
||||
// Auto-redact detected PII in the outbound text
|
||||
if (settings.autoRedactDetected !== false) {
|
||||
@@ -454,7 +454,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
function autoDetectPII(text, ident) {
|
||||
function autoDetectPII(text, ident, opts) {
|
||||
if (!text || text.length < 5) return [];
|
||||
const hasContext = CONTEXT_WORDS_RE.test(text);
|
||||
|
||||
@@ -483,9 +483,11 @@
|
||||
}
|
||||
|
||||
// Proper noun heuristic — catch names, company names, project names
|
||||
// that aren't configured in identity
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
// that aren't configured in identity (opt-in, off by default)
|
||||
if (opts?.detectProperNouns) {
|
||||
const properNouns = detectProperNouns(text, configured);
|
||||
findings.push(...properNouns);
|
||||
}
|
||||
|
||||
// Deduplicate by value
|
||||
const seen = new Set();
|
||||
@@ -1441,7 +1443,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const warnings = autoDetectPII(text, identity);
|
||||
const warnings = autoDetectPII(text, identity, { detectProperNouns: settings.detectProperNouns === true });
|
||||
if (warnings.length > 0) {
|
||||
showPreSendWarning(warnings, target);
|
||||
} else if (preSendWarningEl) {
|
||||
|
||||
Reference in New Issue
Block a user