diff --git a/CloudToButt.crx b/CloudToButt.crx deleted file mode 100644 index a5db2d8b..00000000 Binary files a/CloudToButt.crx and /dev/null differ diff --git a/CloudToButt.zip b/CloudToButt.zip new file mode 100644 index 00000000..fc891648 Binary files /dev/null and b/CloudToButt.zip differ diff --git a/README.md b/README.md index 8b8a2271..138f0ed7 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,25 @@ cloud-to-butt ============= + +##### Fork of [panicsteve/cloud-to-butt](https://github.com/panicsteve/cloud-to-butt) with support to manifest v3 + ![](logo.png) Chrome extension that replaces occurrences of 'the cloud' with 'my butt' -[Direct download of crx file](https://github.com/panicsteve/cloud-to-butt/blob/master/CloudToButt.crx?raw=true) +[Direct download of crx file](https://github.com/gabrielfalcao/cloud-to-butt/blob/master/CloudToButt.zip?raw=true) + -Note that there are forks of this extension that simply replace 'cloud' with 'butt'. -In my personal opinion, that approach is too broad and it's less funny as a result, but it is clearly a very -polarizing issue in the cloud-to-butt user community. Forks are free to do whatever they like. But officially, _this_ extension replaces only the phrase described above, and therefore it did not replace your cloudflare URLs with buttflare URLs. Thank you for your concern. Screenshot Gallery ------------------ http://www.flickr.com/groups/cloud-to-butt/ -Installation ------------- - -In Chrome, choose Window > Extensions. Drag CloudToButt.crx into the page that appears. -Safari Version --------------- -Can be found here: https://github.com/logancollins/cloud-to-butt-safari - -Firefox Version ---------------- - -Can be found here: https://github.com/DaveRandom/cloud-to-butt-mozilla - - -Opera Version ---------------- +Installation +------------ -Can be found here: https://github.com/DaveRandom/cloud-to-butt-opera +In Chrome, choose Window > Extensions. Drag CloudToButt.zip into the page that appears. diff --git a/Source/content_script.js b/Source/content_script.js index 9e6baf57..bb035ecb 100644 --- a/Source/content_script.js +++ b/Source/content_script.js @@ -1,12 +1,13 @@ -walk(document.body); - -function walk(node) +window.onload = function () { + walk(document.body); +} + function walk(node) { // I stole this function from here: // http://is.gd/mwZp7E - + var child, next; - + var tagName = node.tagName ? node.tagName.toLowerCase() : ""; if (tagName == 'input' || tagName == 'textarea') { return; @@ -15,13 +16,13 @@ function walk(node) return; } - switch ( node.nodeType ) + switch ( node.nodeType ) { case 1: // Element case 9: // Document case 11: // Document fragment child = node.firstChild; - while ( child ) + while ( child ) { next = child.nextSibling; walk(child); @@ -35,7 +36,7 @@ function walk(node) } } -function handleText(textNode) +function handleText(textNode) { var v = textNode.nodeValue; @@ -43,8 +44,6 @@ function handleText(textNode) 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; } - - diff --git a/Source/manifest.json b/Source/manifest.json index 205e2c4f..c6571ab9 100644 --- a/Source/manifest.json +++ b/Source/manifest.json @@ -1,15 +1,13 @@ { - "manifest_version": 2, + "manifest_version": 3, "name": "Cloud To Butt", - "version": "1.0", + "version": "1.0.1", "description": "Replaces the text 'the cloud' with 'my butt'.", - "content_scripts": + "content_scripts": [ { "matches": ["*://*/*"], - "js": ["content_script.js"], - "run_at": "document_end" + "js": ["content_script.js"] } ] } -