From 997ca7b29f65c53f6feaf81467b25191f4680bbc Mon Sep 17 00:00:00 2001 From: Steven Frank Date: Mon, 11 Mar 2013 22:31:03 -0700 Subject: [PATCH] First commit --- CloudToButt.crx | Bin 0 -> 1026 bytes Source/content_script.js | 35 +++++++++++++++++++++++++++++++++++ Source/manifest.json | 15 +++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 CloudToButt.crx create mode 100644 Source/content_script.js create mode 100644 Source/manifest.json diff --git a/CloudToButt.crx b/CloudToButt.crx new file mode 100644 index 0000000000000000000000000000000000000000..fb81d2fd977ec0b709a2dc338fe04c3f1b56318d GIT binary patch literal 1026 zcmZ=RGBROeU|?7T#0@}f&^X_KmyJ`a&7Su?G=( zd+sH&Pjjf`cfV$?qPgb!Z{_Ew@At+1(^ZhodM9oh|1r(jxM8|ytZzUGQ;+Lj^S#aM zUb)!{EZqKYb#|v?`h>SqjVl9D?G}^dx&Vy}vwS(tPMAn@2&7r) z>V}ob3nmw{dog#WO=_w#zr{Z1-j1`;yB7ZuW?QX2uhYD&YiVb2ujj^({wojuXkvYl zsQF7sB*2@QMFbd996-##aKrr~rwJnigAyh!6yZu)&|)t2=M3#CU&{{8OhC(X2*=52e#TA8>clf{KoHZn3{&%c&IjU zmBj7dpmpcHSHJqWy7rEz;?eEz4uqV$ZO!pR*wf?7;_hWlrW-uYCD!K&8Zl^k1W4Rf zzLU?e;`KS@-Fp`L3;(JzwV&L%x8dY0z4et7k36gtvfj0>U%w~E()<$l$rDEwR&pk@ zJ8cNp^6H#pFTd`C-jtO-OGKB(m@#hlkeb-Q-M+}V_ED$$bpDf1=2>r+ObfA!=;!g3 zzOQ#`#qrd_X{@F}74!K^elPW{%d%IH{K@}Jc3Yfu%xY&rZI;Kg56W?c?y`=!ny%3% z5uVau@>Cu*h`E{$UfKio#tvb5OBSIGMwio%aV-S zOHY5}_bOMKbWAhKM=9+M^T+$MR|M>mkT^Hj@=m95;*{L?FIHAPdJvuN%6B~WL6{`Z zZj17~H4k4sFcIpU@rUoI;$8g}ZtL5(E$5Bj@P3LL{}ly+eVi$GNA0( z*hjpvY}$pOtywh_3c?DGEi>4t{E|&s*JVDMCj%*zunO>IWdlhw N0bv!8b^v931_1i3ioO5< literal 0 HcmV?d00001 diff --git a/Source/content_script.js b/Source/content_script.js new file mode 100644 index 0000000..fef888a --- /dev/null +++ b/Source/content_script.js @@ -0,0 +1,35 @@ +walk(document.body); + +function walk(node) +{ + // I stole this function from here: + // http://is.gd/mwZp7E + + var child, next; + + switch ( node.nodeType ) + { + case 1: // Element + case 9: // Document + case 11: // Document fragment + child = node.firstChild; + while ( child ) + { + next = child.nextSibling; + walk(child); + child = next; + } + break; + + case 3: // Text node + handleText(node); + break; + } +} + +function handleText(textNode) +{ + textNode.nodeValue = textNode.nodeValue.replace(/\bthe cloud\b/gi, "my butt"); +} + + diff --git a/Source/manifest.json b/Source/manifest.json new file mode 100644 index 0000000..205e2c4 --- /dev/null +++ b/Source/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Cloud To Butt", + "version": "1.0", + "description": "Replaces the text 'the cloud' with 'my butt'.", + "content_scripts": + [ + { + "matches": ["*://*/*"], + "js": ["content_script.js"], + "run_at": "document_end" + } + ] +} +