diff --git a/README.md b/README.md new file mode 100644 index 0000000..e2238fd --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Potatoes Emojis Firefox WebExtension + +**This add-on replaces latest noto-emoji from Google with old "potatoes"(or "worms" or whatever you call it...) emojis from Android 6.0.1 on the Google website Messages for web.** + +## What it does + +This extension just includes: + +* a content script, "replace-emojis.js", that is injected into any pages under "messages.android.com" or any of its subdomains + +The content script intercept HTTP requests to the CDN hosting latest Noto emojis (ssl.gstatic.com) and redirect these requests to an archived version of the noto-emoji Github repository (commit 914c9ecb9d5e6d96c972c8df577cc6a36d162ece). + diff --git a/icons/LICENSE b/icons/LICENSE new file mode 100644 index 0000000..f4c7df1 --- /dev/null +++ b/icons/LICENSE @@ -0,0 +1 @@ +The icon "sleuth-or-spy_1f575" is taken from the Google Noto Emoji project, and is used under the terms of the Apache License 2.0: https://www.apache.org/licenses/LICENSE-2.0 diff --git a/icons/sleuth-or-spy_1f575_128.png b/icons/sleuth-or-spy_1f575_128.png new file mode 100644 index 0000000..bf055eb Binary files /dev/null and b/icons/sleuth-or-spy_1f575_128.png differ diff --git a/icons/sleuth-or-spy_1f575_48.png b/icons/sleuth-or-spy_1f575_48.png new file mode 100644 index 0000000..c5eb044 Binary files /dev/null and b/icons/sleuth-or-spy_1f575_48.png differ diff --git a/icons/sleuth-or-spy_1f575_96.png b/icons/sleuth-or-spy_1f575_96.png new file mode 100644 index 0000000..0555ae9 Binary files /dev/null and b/icons/sleuth-or-spy_1f575_96.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..c377a9b --- /dev/null +++ b/manifest.json @@ -0,0 +1,23 @@ +{ + "description": "Replace latest noto-emoji from Google with old \"potatoes\"(or \"worms\" or whatever you call it...) emojis from Android 6.0.1 on the Google website Messages for web", + "manifest_version": 2, + "name": "Potatoes Emojis", + "version": "1.0", + + "permissions": [ + "webRequest", + "webRequestBlocking", + "*://messages.android.com/*", + "*://ssl.gstatic.com/*" + ], + + "background": { + "scripts": ["replace-emojis.js"] + }, + + "icons": { + "48": "icons/sleuth-or-spy_1f575_48.png", + "96": "icons/sleuth-or-spy_1f575_96.png", + "128": "icons/sleuth-or-spy_1f575_128.png" + } +} \ No newline at end of file diff --git a/replace-emojis.js b/replace-emojis.js new file mode 100644 index 0000000..5ebd7fe --- /dev/null +++ b/replace-emojis.js @@ -0,0 +1,14 @@ +var pattern = "*://ssl.gstatic.com/dynamite/emoji/*"; + +function redirect(requestDetails) { + // Replace origin URL with archived Google Emoji equivalent from noto-emoji repository + return { + redirectUrl: requestDetails.url.replace("ssl.gstatic.com/dynamite/emoji", "raw.githubusercontent.com/googlei18n/noto-emoji/914c9ecb9d5e6d96c972c8df577cc6a36d162ece") + }; +} + +browser.webRequest.onBeforeRequest.addListener( + redirect, + {urls: [pattern], types:["image"]}, + ["blocking"] +); \ No newline at end of file