summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-11 23:14:29 +0500
committerilotterytea <iltsu@alright.party>2025-12-11 23:14:29 +0500
commit5af7121ef495ce4d04b39da470331dd6421025d9 (patch)
tree70663989f25929cc0bde7923e42babdc7f50ea3e
initial commit
-rw-r--r--chat.js5
-rw-r--r--extension.js17
-rw-r--r--icons/48.pngbin0 -> 4621 bytes
-rw-r--r--manifest.json20
4 files changed, 42 insertions, 0 deletions
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
--- /dev/null
+++ b/icons/48.png
Binary files 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