User:Aafi/PageLinksCopier

PageLinksCopier
Description Convenient link copying
Author
Status Stable
First released June 22, 2023; 10 months ago (2023-06-22)
Updated January 18, 2024; 3 months ago (2024-01-18)
Browser support All modern browsers
Skin support All desktop and mobile skins
Source User:Aafi/PageLinksCopier.js

Install PageLinksCopier and copy decoded links to the pages and files (majorly non-Latin) in one-go!

Development edit

PageLinksCopier was firstly created on Kashmiri Wikipedia by Nadeemulhaqmir to help copy decoded links of pages. The default result of copying a link is, for instance, https://ks.wikipedia.org/wiki/%DB%81%D9%90%D9%86%D8%AF%D9%88%D8%B3%D8%AA%D8%A7%D9%86 - which leads one to the article about "India" on Kashmiri Wikipedia. The script decodes %DB%81%D9%90%D9%86%D8%AF%D9%88%D8%B3%D8%AA%D8%A7%D9%86 to the title of the page, and works almost on all of the namespaces including Special ones, with an exception of Special:MobileDiff. For the given article, it produces a link this way https://ks.wikipedia.org/wiki/ہِندوستان.

This is a problem with almost all of the non-English titles including Urdu, Hindi, Punjabi, Marathi, Kashmir, among others. If you copy a link in one go, install this on your common.js, and enjoy copying links. This is so easy since it produces a "clipboard" icon on the top of a page.

Subsequent improvements edit

I am not a tech-person but I enjoy doing some tweaks around. This script has received significant contributions from Yethrosh for its functionality on several Special pages.

Local installation edit

This should be added on the common.js page:

importScript('User:Aafi/PageLinksCopier.js'); // Backlink: [[User:Aafi/PageLinksCopier.js]]

Elsewhere edit

This works on all Wikis. You might want to add on your common.js (else global.js), the following lines to make it work:

mw.loader.load("//commons.wikimedia.org/w/index.php?title=User:TheAafi/PageLinksCopier.js&action=raw&ctype=text/javascript");

Translations and questions edit

The script uses two translation strings, "Copy Link" and a notification, "The link has been copied. Enjoy!" If you want to have it included in your language, please leave me a message on User talk:Aafi. Current translations include: ar, mr, ur