my website banner

initial commit
authorDavid Polakovic <email@dpolakovic.space>
Sat, 1 Nov 2025 13:36:59 +0000 (14:36 +0100)
committerDavid Polakovic <email@dpolakovic.space>
Sat, 1 Nov 2025 13:36:59 +0000 (14:36 +0100)
content.js [new file with mode: 0644]
icons/128.png [new file with mode: 0644]
icons/32.png [new file with mode: 0644]
icons/64.png [new file with mode: 0644]
manifest.json [new file with mode: 0644]
r3-d1.zip [new file with mode: 0644]

diff --git a/content.js b/content.js
new file mode 100644 (file)
index 0000000..b0d72cf
--- /dev/null
@@ -0,0 +1,12 @@
+// Look for the Legends version image
+const legendsImg = document.querySelector('img[alt="Click here for Wookieepedia\'s article on the Legends version of this subject."]');
+
+if (legendsImg) {
+  // Get the parent link element
+  const legendsLink = legendsImg.closest('a');
+  
+  if (legendsLink && legendsLink.href) {
+    // Redirect to the Legends version
+    window.location.href = legendsLink.href;
+  }
+}
\ No newline at end of file
diff --git a/icons/128.png b/icons/128.png
new file mode 100644 (file)
index 0000000..a5190fc
Binary files /dev/null and b/icons/128.png differ
diff --git a/icons/32.png b/icons/32.png
new file mode 100644 (file)
index 0000000..8d19ab9
Binary files /dev/null and b/icons/32.png differ
diff --git a/icons/64.png b/icons/64.png
new file mode 100644 (file)
index 0000000..375b2cc
Binary files /dev/null and b/icons/64.png differ
diff --git a/manifest.json b/manifest.json
new file mode 100644 (file)
index 0000000..724d52e
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "manifest_version": 3,
+  "name": "R3-D1 droid for navigating Wookiepedia",
+  "version": "1.0",
+  "description": "Automatically redirects users to the Legends version of articles on Wookiepedia.",
+  
+  "permissions": ["scripting"],
+  "host_permissions": ["*://starwars.fandom.com/wiki/*"],
+  
+  "action": {
+    "default_title": "R3-D1"
+  },
+  
+  "icons": {
+    "32": "icons/32.png",
+    "128": "icons/128.png"
+  },
+  
+  "content_scripts": [
+    {
+      "matches": ["*://starwars.fandom.com/wiki/*"],
+      "js": ["content.js"],
+      "run_at": "document_end"
+    }
+  ],
+  
+  "browser_specific_settings": {
+    "gecko": {
+      "id": "wookiepedia-legends-redirect@dpolakovic.space"
+    }
+  }
+}
\ No newline at end of file
diff --git a/r3-d1.zip b/r3-d1.zip
new file mode 100644 (file)
index 0000000..105185f
Binary files /dev/null and b/r3-d1.zip differ