aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxbian <oxbian@mailbox.org>2024-10-26 18:12:00 -0400
committerOxbian <oxbian@mailbox.org>2024-10-26 18:12:00 -0400
commiteb97a76443a8879ced2bc79c98dcd992f44afe4c (patch)
treeae55a1f43fc046a75228f76c8500d9817dd99a35
downloaddiscord-no-nitro-emoji-eb97a76443a8879ced2bc79c98dcd992f44afe4c.tar.gz
discord-no-nitro-emoji-eb97a76443a8879ced2bc79c98dcd992f44afe4c.zip
INIT: v1 + v1.1 copy emoji from menu or chat into clipboard
-rw-r--r--README.md10
-rw-r--r--main.js55
-rw-r--r--manifest.json23
3 files changed, 88 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ae2964d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,10 @@
+# Discord Emoji without Nitro
+---
+
+Send animated or not emoji everywhere without using discord nitro.
+Why paying for just using some links ....
+
+# Version
+
+v1: copy emoji from emoji menu into the clipboard
+v1.1: copy emoji from chat into the clipboard
diff --git a/main.js b/main.js
new file mode 100644
index 0000000..1382cde
--- /dev/null
+++ b/main.js
@@ -0,0 +1,55 @@
+setInterval(function () {
+ // Delete lockicon on nitro emote
+ document.querySelector('#emoji-picker-grid ul li button [class^="emojiLockIconContainer"]')?.remove();
+
+ //Remove annoying nitro banner that appears when emote is clicked
+ document.querySelector("div[class*='emojiPicker'] div[class*='hasTabParentContainer']")?.remove();
+ document.querySelector("div[class*='emojiPicker'] div[class*='backdrop']")?.remove();
+ document.querySelector("[class^='upsellContainer']")?.remove();
+ // Discord crash if bellow removed
+ //document.querySelector("[class^='nitroTopDividerContainer']")?.remove();
+ // Remove class categorySectionNitroLocked sur ceux ayant la classe les div categorySection*/
+}, 100);
+
+setInterval(function () {
+ // Add event listener on emote to copy them
+ document.querySelectorAll("div[class*='listItems'] div[class*='categorySection'] ul li button").forEach((btn) => {
+ if (btn.getAttribute("affected") !== "true") {
+ btn.setAttribute("affected", "true");
+
+ btn.addEventListener("click", (e) => {
+ let source = e.currentTarget.querySelector("img").getAttribute('src');
+ copyTextToClipboard(source)
+ });
+ }
+ });
+}, 1000);
+
+async function copyTextToClipboard(textToCopy) {
+ try {
+ if (navigator?.clipboard?.writeText) {
+ await navigator.clipboard.writeText(textToCopy);
+ }
+ } catch (err) {
+ console.error(err);
+ }
+}
+
+// Ajoute un écouteur d'événement de clic au document pour capturer les clics sur les images emoji
+document.addEventListener("click", function(event) {
+ // Vérifie si l'élément cliqué est une image avec la classe 'emoji'
+ if (event.target.classList.contains("emoji")) {
+ // Sélectionne le parent (ou ancêtre) ayant un id commençant par 'message-content'
+ const parentDiv = event.target.closest("div[id^='message-content']");
+
+ // Vérifie que l'image est bien dans une div dont l'id commence par 'message-content'
+ if (parentDiv) {
+ let source = event.target.getAttribute('src');
+ let parsedUrl = new URL(source);
+ parsedUrl.searchParams.set("size", "48");
+ copyTextToClipboard(parsedUrl.toString());
+ }
+ }
+});
+
+// copier le lien dans [class^='markup'] div span span span.text
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 0000000..0e64e27
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,23 @@
+{
+ "manifest_version": 2,
+ "author": "Oxbian",
+ "developer": {
+ "name": "Oxbian",
+ "url": "https://arka.rocks"
+ },
+ "version": "1.1",
+ "name": "Discord No Nitro Emoji",
+ "permissions": [
+ "clipboardWrite"
+ ],
+ "content_scripts": [
+ {
+ "matches": [
+ "*://discord.com/*"
+ ],
+ "js": [
+ "main.js"
+ ]
+ }
+ ]
+}
ArKa projects. All rights to me, and your next child right arm.