diff --git a/Source/icon128.png b/Millennials to Snake People.safariextension/Icon-128.png similarity index 100% rename from Source/icon128.png rename to Millennials to Snake People.safariextension/Icon-128.png diff --git a/Source/icon16.png b/Millennials to Snake People.safariextension/Icon-16.png similarity index 100% rename from Source/icon16.png rename to Millennials to Snake People.safariextension/Icon-16.png diff --git a/Source/icon32.png b/Millennials to Snake People.safariextension/Icon-32.png similarity index 100% rename from Source/icon32.png rename to Millennials to Snake People.safariextension/Icon-32.png diff --git a/Source/icon48.png b/Millennials to Snake People.safariextension/Icon-48.png similarity index 100% rename from Source/icon48.png rename to Millennials to Snake People.safariextension/Icon-48.png diff --git a/Millennials to Snake People.safariextension/Info.plist b/Millennials to Snake People.safariextension/Info.plist new file mode 100644 index 00000000..2a3ce489 --- /dev/null +++ b/Millennials to Snake People.safariextension/Info.plist @@ -0,0 +1,52 @@ + + + + + Author + Alexsander Akers + Builder Version + 10600.6.3 + CFBundleDisplayName + Millennials to Snake People + CFBundleIdentifier + us.pandamonia.millennials-to-snake-people + CFBundleInfoDictionaryVersion + 6.0 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + Chrome + + Content + + Scripts + + End + + content_script.js + + + + Description + Learn the sad, sinister truth behind the mysterious Snake People. Who are they? What do they want? + DeveloperIdentifier + 94C3W2AV74 + ExtensionInfoDictionaryVersion + 1.0 + Permissions + + Website Access + + Include Secure Pages + + Level + All + + + Update Manifest URL + https://a2.github.io/ + Website + https://github.com/a2/millennials-to-snake-people + + diff --git a/Source/content_script.js b/Millennials to Snake People.safariextension/content_script.js similarity index 93% rename from Source/content_script.js rename to Millennials to Snake People.safariextension/content_script.js index 35547e41..963aed5d 100644 --- a/Source/content_script.js +++ b/Millennials to Snake People.safariextension/content_script.js @@ -2,30 +2,20 @@ walk(document.body); document.title = replaceText(document.title); -function walk(node) +function walk(rootNode) { - // 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; + // Find all the text nodes in rootNode + var walker = document.createTreeWalker( + rootNode, + NodeFilter.SHOW_TEXT, + null, + false + ), + node; + + // Modify each text node's value + while (node = walker.nextNode()) { + handleText(node); } } diff --git a/MillennialsToSnakePeople.crx b/MillennialsToSnakePeople.crx deleted file mode 100644 index 5e386a93..00000000 Binary files a/MillennialsToSnakePeople.crx and /dev/null differ diff --git a/Source/manifest.json b/Source/manifest.json deleted file mode 100644 index 47eb047c..00000000 --- a/Source/manifest.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "manifest_version": 2, - - "name": "Millennials to Snake People", - "short_name": "Snake People", - "description": "Replaces the text 'Millennial' with 'Snake People'.", - "author": "Eric Bailey", - "version": "1.2", - - "icons": { - "16": "icon16.png", - "32": "icon32.png", - "48": "icon48.png", - "128": "icon128.png" - }, - - "content_scripts": - [ - { - "matches": ["*://*/*"], - "js": ["content_script.js"], - "run_at": "document_end" - } - ] -} -