├── Screenshot.png ├── README.md ├── src ├── manifest.json └── content_script.js └── LICENSE.txt /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenschmatz/dj-khaledify/HEAD/Screenshot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dj-khaledify 2 | Chrome extension that replaces all instances of "key" to the key emoji. 3 | 4 | [Download it here!](https://chrome.google.com/webstore/detail/dj-khaledify/kadkjmconegfdacmcblecejmldnokpbh) 5 | 6 | ![Preview](Screenshot.png) 7 | 8 | And super huge thanks to the [Cloud-to-Butt extension](https://chrome.google.com/webstore/detail/cloud-to-butt-plus/apmlngnhgbnjpajelfkmabhkfapgnoai?hl=en), whose code showed me the way. 9 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "DJ Khaledify", 4 | "version": "1.0", 5 | "author": "Steven Schmatz", 6 | "description": "Replaces the text 'key' with '🔑'.", 7 | "icons": { 8 | "16": "key16.png", 9 | "48": "key48.png", 10 | "128": "key128.png" 11 | }, 12 | "content_scripts": 13 | [ 14 | { 15 | "matches": ["*://*/*"], 16 | "js": ["content_script.js"], 17 | "run_at": "document_end" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /src/content_script.js: -------------------------------------------------------------------------------- 1 | walk(window.document.body); 2 | 3 | function walk(node) 4 | { 5 | var child, next; 6 | 7 | switch ( node.nodeType ) 8 | { 9 | case 1: // Element 10 | case 9: // Document 11 | case 11: // Document fragment 12 | child = node.firstChild; 13 | while ( child ) 14 | { 15 | next = child.nextSibling; 16 | walk(child); 17 | child = next; 18 | } 19 | break; 20 | 21 | case 3: // Text node 22 | handleText(node); 23 | break; 24 | } 25 | } 26 | 27 | function handleText(textNode) 28 | { 29 | var h = textNode.parentNode.innerHTML; 30 | if (h.match(/