From 5af7121ef495ce4d04b39da470331dd6421025d9 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 11 Dec 2025 23:14:29 +0500 Subject: initial commit --- chat.js | 5 +++++ extension.js | 17 +++++++++++++++++ icons/48.png | Bin 0 -> 4621 bytes manifest.json | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 chat.js create mode 100644 extension.js create mode 100644 icons/48.png create mode 100644 manifest.json diff --git a/chat.js b/chat.js new file mode 100644 index 0000000..080fb4c --- /dev/null +++ b/chat.js @@ -0,0 +1,5 @@ +function getChannelName() { + const path = window.location.pathname.split('/').filter(Boolean); + if (path.length == 1) return path[path.length - 1]; + return null; +} \ No newline at end of file diff --git a/extension.js b/extension.js new file mode 100644 index 0000000..f910541 --- /dev/null +++ b/extension.js @@ -0,0 +1,17 @@ +const start = () => { + // if there is no chat + if (document.querySelector("div[data-a-target=chat-input]") == null) { + return; + } + console.log(getChannelName()); +}; + +function onPageReady(cb) { + if (document.readyState === 'complete' || document.readyState === 'interactive') { + cb(); + } else { + document.addEventListener("DOMContentLoaded", db); + } +} + +onPageReady(start); diff --git a/icons/48.png b/icons/48.png new file mode 100644 index 0000000..3f4f6f8 Binary files /dev/null and b/icons/48.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..70442f8 --- /dev/null +++ b/manifest.json @@ -0,0 +1,20 @@ +{ + "manifest_version": 2, + "name": "TinyExtension", + "version": "0.1.0", + "description": "TinyEmotes support for Twitch chat", + "icons": { + "48": "icons/48.png" + }, + "content_scripts": [ + { + "matches": [ + "*://*.twitch.tv/*" + ], + "js": [ + "chat.js", + "extension.js" + ] + } + ] +} \ No newline at end of file -- cgit v1.2.3