Skip to content
Browse files

improved case preservation

  • Loading branch information...
1 parent a2d1978 commit ce727bfd94d42aa28d89569872f7bf4a42af53fd @panicsteve committed
Showing with 8 additions and 1 deletion.
  1. BIN CloudToButt.crx
  2. +8 −1 Source/content_script.js
View
BIN CloudToButt.crx
Binary file not shown.
View
9 Source/content_script.js
@@ -29,7 +29,14 @@ function walk(node)
function handleText(textNode)
{
- textNode.nodeValue = textNode.nodeValue.replace(/\bThe cloud\b/g, "My butt").replace(/\bthe cloud\b/gi, "my butt");
+ var v = textNode.nodeValue;
+
+ v = v.replace(/\bThe Cloud\b/g, "My Butt");
+ v = v.replace(/\bThe cloud\b/g, "My butt");
+ v = v.replace(/\bthe Cloud\b/g, "my Butt");
+ v = v.replace(/\bthe cloud\b/g, "my butt");
+
+ textNode.nodeValue = v;
}

1 comment on commit ce727bf

@dsandler

I noticed the other day that the extension was doing its best to preserve case; it was delightful.

Please sign in to comment.
Something went wrong with that request. Please try again.