Pattern Mapping Replacer - Multi-Site

Replaces text based on a mapping with exact matching and site-specific filtering

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Author
Kreezxil
Daily installs
1
Total installs
1
Ratings
0 0 0
Version
1.2
Created
2026-03-21
Updated
2026-03-21
Size
2.88 KB
License
MIT; explicity from MIT license, you must link back to this script.
Applies to
All sites

Pattern Mapping Replacer - Multi-Site

This Tampermonkey userscript performs automated text replacement across websites based on a customizable mapping dictionary. It is specifically designed to handle site-specific filtering and case-sensitivity toggles.

Core Features

  • Dynamic Text Replacement: Replaces specific words or phrases within the visible text of a webpage.
  • Site-Specific Filtering: Replacements can be restricted to specific domains (e.g., sefaria.org) or applied globally.
  • Case Sensitivity Control: Each entry in the mapping can be set to either an exact match (true) or case-insensitive (false).
  • Whole Word Matching: Uses regex word boundaries (\b) to ensure it only replaces whole words and not fragments within larger words.
  • Live Updates: Utilizes a MutationObserver to watch for changes in the DOM, ensuring that text loaded dynamically is also replaced.
  • Protected Elements: Automatically ignores script tags, style blocks, textareas, and input fields to prevent breaking site functionality.

Configuration Structure

The script uses a mapping object where each entry follows this format:
"Original Word": [ExactMatch (Boolean), AllowedSites (Array), "Replacement Word"]

  • ExactMatch: If true, the script only replaces the exact casing provided.
  • AllowedSites: An array of domain strings. If the array is empty ([]), the replacement applies to all websites.
  • Replacement: The string that will replace the original pattern.

Notes

  • Other array variables can be defined for sites, so that you can easily tailor matches to any sites.
  • You don't have to use the array variables, you can manually define the arrays in each section. I recommend the variables.