From: David Polakovic Date: Sat, 1 Nov 2025 13:36:59 +0000 (+0100) Subject: initial commit X-Git-Url: https://git.dpolakovic.space/?a=commitdiff_plain;h=d4b6a76960f5ec32dd5107d990f9c11515c11e91;p=browser-r3-d1 initial commit --- d4b6a76960f5ec32dd5107d990f9c11515c11e91 diff --git a/content.js b/content.js new file mode 100644 index 0000000..b0d72cf --- /dev/null +++ b/content.js @@ -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 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 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 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 index 0000000..724d52e --- /dev/null +++ b/manifest.json @@ -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 index 0000000..105185f Binary files /dev/null and b/r3-d1.zip differ