Pattern Mapping Replacer - Multi-Site

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Autor
Kreezxil
Dziennych instalacji
1
Wszystkich instalacji
1
Oceny
0 0 0
Wersja
1.2
Utworzono
21-03-2026
Zaktualizowano
21-03-2026
Rozmiar
2,88 KB
Licencja
MIT; explicity from MIT license, you must link back to this script.
Dotyczy
Wszystkie strony

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.