diff --git a/CloudToButt.crx b/CloudToButt.crx new file mode 100644 index 0000000..fb81d2f Binary files /dev/null and b/CloudToButt.crx differ 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" + } + ] +} +