Skip to content

pelmers/text-rewriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Rewriter

A small WebExtension to rewrite customizable patterns in a page as something else. Created mostly for personal amusement, inspired by XKCD #1288. By default this provides a "mispell" -> "misspell" replacement.

The plugin supports any Javascript regular expressions, including using backrefs and captures. We just visit the visible text nodes on the page and use nodeValue.replace for each provided pattern. This means if there is an overlapping pair of patterns A -> B and B -> C, then A - > C is shown.

Install

Firefox

Chrome

Latest changes

  • Add preference to make a list of domains exempt from text replacement (#6)
  • Add preference to skip children of <pre> and <code> tags from replacement