Skip to content

v3.1.4 - Black Friday 🎁, Nov 28th, 2025

Choose a tag to compare

@DanielSnor DanielSnor released this 28 Nov 08:00
· 17 commits to main since this release
1f6601c

What's New in v3.1.4

🔧 Critical Fix: URL_DOMAIN_FIXES Processing Order

This release fixes a critical bug in URL_DOMAIN_FIXES processing that could cause domains with existing protocols to be incorrectly modified.

The Problem:
In v3.1.3, the regex pattern for domain fixes used a negative lookbehind ((?<!https?:\/\/)) which is not supported in ES5 runtime. While the script compiled without errors, this caused:

  • Domains with existing https:// or http:// protocols to be processed incorrectly
  • Potential duplicate protocol prefixes in some edge cases
  • Unpredictable behavior when domains appeared multiple times in content

The Solution:
Replaced the negative lookbehind with a two-pattern approach that explicitly handles both cases:

  1. Pattern 1 (runs FIRST): Protects already valid URLs

    • Matches: https://domain or http://domain
    • Action: Replaces with itself (no modification)
    • Purpose: Prevents double-processing of valid URLs
  2. Pattern 2 (runs SECOND): Adds https:// to bare domains

    • Matches: Bare domains at word boundaries
    • Action: Adds https:// prefix
    • Purpose: Fixes domains missing protocol

Technical Implementation:

// Pattern 1: Protect valid URLs (https://domain or http://domain)
domainPatterns.push({
  pattern: "(https?:\\/\\/)" + escapedDomain + "(\\/[^\\s]*|[\\s]|$)",
  replacement: "$1" + domain + "$2",
  flags: "gm",
  literal: false
});

// Pattern 2: Add https:// to bare domains at boundaries
domainPatterns.push({
  pattern: "(^|[\\s\\(\\[\\{<\"'])" + escapedDomain + "(\\/[^\\s\\)\\]\\}>\"',;]*|[\\s\\)\\]\\}>\"',;]|$)",
  replacement: "$1https://" + domain + "$2",
  flags: "gm",
  literal: false
});

Key Features:

  • ES5 Compatible: No negative lookbehind required
  • Order-Dependent: Pattern 1 runs before Pattern 2 to prevent conflicts
  • Boundary-Aware: Pattern 2 respects word boundaries to avoid matching substrings
  • Path-Preserving: Both patterns preserve URL paths correctly

🔤 Unicode Normalization

  • Fixed mojibake characters in comments and string literals throughout the codebase
  • Corrected display of Czech characters (např., příspěvek)
  • Fixed ellipsis character (…) representation in comments
  • Normalized emoji rendering (𝕏, 🦋, 📝, 💬, 📤, 🖼️, 🔗)
  • Improved character encoding for ampersand safe character (⅋)

These are cosmetic fixes that improve code readability without affecting functionality.

Migration from v3.1.3

This is a bug fix release. No configuration changes are required.

Recommended Actions:

  1. Replace your current script with v3.1.4
  2. If you use URL_DOMAIN_FIXES, test with content containing:
    • Domains with existing https:// prefixes
    • Bare domains without protocols
    • Multiple occurrences of the same domain
  3. Verify that URLs are processed correctly

Breaking Changes:

  • None. This release maintains full backward compatibility.

Testing

All existing tests pass with 100% success rate. Additional test coverage added for:

  • URL_DOMAIN_FIXES with existing protocols
  • Multiple occurrences of domains in content
  • Mixed protocol scenarios

Installation

  1. Copy the entire content of example-ifttt-filter-x-xcom-3_1_4.ts
  2. Paste into your IFTTT applet filter code
  3. Configure SETTINGS according to your needs
  4. Test with beta bot before production deployment

File Information

  • Filename: example-ifttt-filter-x-xcom-3_1_4.ts
  • Size: ~64KB (within IFTTT limits)
  • TypeScript Version: 2.9.2 (ES5 compatible)
  • IFTTT Runtime: ES5

Known Issues

None at this time.

Next Steps

  • Monitor production deployment for 24-48 hours
  • Consider URL_DOMAIN_FIXES enhancements for future versions
  • Continue optimization of regex patterns for performance

Related Files

  • Main script: example-ifttt-filter-x-xcom-3_1_4.ts
  • Documentation: See Unified_Filter_Guide__-_v3_1_0.md for complete usage guide
  • Settings reference: See Settings_for_IFTTT_filter_script_-_v3_1_0.md

Credits

Developed and maintained by Daniel for Zprávobot.news

License

This script is part of the Zprávobot.news project.