Browse Source

🅱️oca🅱️ola

kline 3 months ago
commit
de59077428
4 changed files with 40 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 4
    0
      readme.md
  3. 16
    0
      src/bocabola.js
  4. 19
    0
      src/manifest.json

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+*.swp

+ 4
- 0
readme.md View File

@@ -0,0 +1,4 @@
1
+Boca Bola
2
+=========
3
+
4
+It just memes you to life

+ 16
- 0
src/bocabola.js View File

@@ -0,0 +1,16 @@
1
+function replaceInText(element, pattern, replacement) {
2
+    for (let node of element.childNodes) {
3
+        switch (node.nodeType) {
4
+            case Node.ELEMENT_NODE:
5
+                replaceInText(node, pattern, replacement);
6
+                break;
7
+            case Node.TEXT_NODE:
8
+                node.textContent = node.textContent.replace(pattern, replacement);
9
+                break;
10
+            case Node.DOCUMENT_NODE:
11
+                replaceInText(node, pattern, replacement);
12
+        }
13
+    }
14
+}
15
+
16
+replaceInText(document.body, /b/gi, "🅱️");

+ 19
- 0
src/manifest.json View File

@@ -0,0 +1,19 @@
1
+{
2
+    "manifest_version": 2,
3
+
4
+    "name": "Boca Bola",
5
+    "version": "0.2",
6
+
7
+    "permissions": [
8
+        "<all_urls>"
9
+    ],
10
+
11
+    "content_scripts": [
12
+        {
13
+            "matches": ["<all_urls>"],
14
+            "js": ["bocabola.js"]
15
+        }
16
+    ]
17
+}
18
+
19
+

Loading…
Cancel
Save