Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Chrome Manifest v3 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed CloudToButt.crx
Binary file not shown.
Binary file added CloudToButt.zip
Binary file not shown.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 10 additions & 11 deletions Source/content_script.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand All @@ -35,16 +36,14 @@ function walk(node)
}
}

function handleText(textNode)
function handleText(textNode)
{
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;
}


10 changes: 4 additions & 6 deletions Source/manifest.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]
}