--- /dev/null
+// 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
--- /dev/null
+{
+ "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