Author SHA1 Message Date
Outis 556aee1d6d Merge pull request #80 from outis1one/claude/fix-firefox-signing-2qWJd
Bump version to 0.9.47
2026-04-20 21:19:19 -04:00
Claude 20250278bc Bump version to 0.9.47
https://claude.ai/code/session_01G6wo3QBwKjEgAM7j5hQkx4
2026-04-21 01:17:52 +00:00
Outis 5666348c57 Merge pull request #79 from outis1one/claude/fix-firefox-signing-2qWJd
fix: force IPv4 DNS in web-ext sign to fix fetch failed error
2026-04-20 21:17:08 -04:00
Claude 459130b049 fix: force IPv4 DNS in web-ext sign to fix fetch failed error
Node.js 18+ resolves DNS with IPv6 preference by default. On Linux systems
where IPv6 routing to addons.mozilla.org is broken or unavailable, this causes
web-ext's fetch to silently fail. Setting --dns-result-order=ipv4first via
NODE_OPTIONS ensures IPv4 is tried first.

https://claude.ai/code/session_01G6wo3QBwKjEgAM7j5hQkx4
2026-04-21 01:14:57 +00:00
7 changed files with 23 additions and 52 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Silent Send",
"version": "0.9.46",
"version": "0.9.47",
"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": "0.9.46",
"version": "0.9.47",
"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": "0.9.46",
"version": "0.9.47",
"private": true,
"license": "MIT",
"description": "Browser extension that substitutes personal data before sending to AI services",
+3 -1
View File
@@ -86,7 +86,9 @@ for attempt in $(seq 1 $MAX_ATTEMPTS); do
echo "=== Attempt $attempt: signing v$NEW_VERSION ==="
# Capture output to check for specific errors
OUTPUT=$(npx web-ext sign \
# NODE_OPTIONS forces IPv4 DNS resolution first — Node.js 18+ defaults to IPv6,
# which silently fails when the system can't reach addons.mozilla.org over IPv6.
OUTPUT=$(NODE_OPTIONS='--dns-result-order=ipv4first' npx web-ext sign \
--no-config-discovery \
--source-dir "$SCRIPT_DIR/dist/firefox" \
--artifacts-dir "$SCRIPT_DIR/dist/firefox-signed" \
+9 -18
View File
@@ -51,8 +51,8 @@
for (const m of sorted) {
if (!m.enabled || !m.real?.trim() || !m.substitute?.trim()) continue;
const pattern = wordBoundary(m.real);
const regex = new RegExp(pattern, m.caseSensitive ? 'g' : 'gi');
const escaped = esc(m.real);
const regex = new RegExp(escaped, m.caseSensitive ? 'g' : 'gi');
let match;
while ((match = regex.exec(result)) !== null) {
replacements.push({
@@ -71,8 +71,8 @@
const sorted = [...maps].sort((a, b) => b.substitute.length - a.substitute.length);
for (const m of sorted) {
if (!m.enabled || !m.real?.trim() || !m.substitute?.trim()) continue;
const pattern = wordBoundary(m.substitute);
const regex = new RegExp(pattern, m.caseSensitive ? 'g' : 'gi');
const escaped = esc(m.substitute);
const regex = new RegExp(escaped, m.caseSensitive ? 'g' : 'gi');
result = result.replace(regex, m.real);
}
return result;
@@ -82,15 +82,6 @@
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
// Add \b only on word-character edges so "not" doesn't match inside "nothing",
// while leaving non-word edges (e.g. "@foo") alone since they self-delimit.
function wordBoundary(str) {
const escaped = esc(str);
const left = /^\w/.test(str) ? '\\b' : '';
const right = /\w$/.test(str) ? '\\b' : '';
return left + escaped + right;
}
// ============================================================
// Smart Pattern Engine (inline for page world)
// ============================================================
@@ -1052,8 +1043,8 @@
const pairs = getRevealPairs();
let result = text;
for (const p of pairs) {
const pattern = wordBoundary(p.from);
const regex = new RegExp(pattern, p.caseSensitive ? 'g' : 'gi');
const escaped = esc(p.from);
const regex = new RegExp(escaped, p.caseSensitive ? 'g' : 'gi');
result = result.replace(regex, p.to);
}
return result;
@@ -1094,9 +1085,9 @@
const pairs = getRevealPairs();
let result = text;
for (const p of pairs) {
const pattern = wordBoundary(p.to);
const regex = new RegExp(pattern, p.caseSensitive ? 'g' : 'gi');
result = result.replace(regex, p.from);
const escaped = esc(p.to); // p.to is the real value
const regex = new RegExp(escaped, p.caseSensitive ? 'g' : 'gi');
result = result.replace(regex, p.from); // p.from is the substitute
}
return result;
}
+8 -18
View File
@@ -23,8 +23,8 @@ const SubstitutionEngine = {
for (const mapping of sorted) {
if (!mapping.enabled || !mapping.real?.trim() || !mapping.substitute?.trim()) continue;
const pattern = this._wordBoundaryPattern(mapping.real);
const regex = new RegExp(pattern, mapping.caseSensitive ? 'g' : 'gi');
const escaped = this._escapeRegex(mapping.real);
const regex = new RegExp(escaped, mapping.caseSensitive ? 'g' : 'gi');
let match;
while ((match = regex.exec(result)) !== null) {
@@ -56,8 +56,8 @@ const SubstitutionEngine = {
for (const mapping of sorted) {
if (!mapping.enabled || !mapping.real?.trim() || !mapping.substitute?.trim()) continue;
const pattern = this._wordBoundaryPattern(mapping.substitute);
const regex = new RegExp(pattern, mapping.caseSensitive ? 'g' : 'gi');
const escaped = this._escapeRegex(mapping.substitute);
const regex = new RegExp(escaped, mapping.caseSensitive ? 'g' : 'gi');
result = result.replace(regex, mapping.real);
}
@@ -73,8 +73,8 @@ const SubstitutionEngine = {
for (const mapping of mappings) {
if (!mapping.enabled || !mapping.real?.trim()) continue;
const pattern = this._wordBoundaryPattern(mapping.real);
const regex = new RegExp(pattern, mapping.caseSensitive ? 'g' : 'gi');
const escaped = this._escapeRegex(mapping.real);
const regex = new RegExp(escaped, mapping.caseSensitive ? 'g' : 'gi');
if (regex.test(text)) {
found.push({
@@ -105,8 +105,8 @@ const SubstitutionEngine = {
for (const mapping of sorted) {
if (!mapping.enabled || !mapping.real?.trim() || !mapping.substitute?.trim()) continue;
const pattern = this._wordBoundaryPattern(mapping.real);
const regex = new RegExp(pattern, mapping.caseSensitive ? 'g' : 'gi');
const escaped = this._escapeRegex(mapping.real);
const regex = new RegExp(escaped, mapping.caseSensitive ? 'g' : 'gi');
let match;
while ((match = regex.exec(original)) !== null) {
@@ -145,16 +145,6 @@ const SubstitutionEngine = {
_escapeRegex(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
},
// Wrap an escaped literal in \b only on edges that are word characters,
// so "not" → "bad" matches "not" but not "nothing", while mappings whose
// edges aren't word chars (e.g. "@foo", "foo.com ") still work.
_wordBoundaryPattern(str) {
const escaped = this._escapeRegex(str);
const left = /^\w/.test(str) ? '\\b' : '';
const right = /\w$/.test(str) ? '\\b' : '';
return left + escaped + right;
},
};
// Support both module and content-script contexts
-12
View File
@@ -345,18 +345,6 @@ test('Disabled mapping is skipped', () => {
if (result.text.includes('Alex Demo')) throw 'Disabled mapping should not substitute';
});
test('Mapping matches whole words only', () => {
const result = SubstitutionEngine.substitute('nothing is not a thing, not even this', [
{ real: 'not', substitute: 'bad', enabled: true }
]);
if (result.text.includes('bahing') || result.text.includes('badhing')) {
throw `Should not match inside "nothing", got: ${result.text}`;
}
if (!/\bbad\b/.test(result.text)) {
throw `Should still match standalone "not", got: ${result.text}`;
}
});
// ============================================================
// SMART PATTERNS
// ============================================================