User talk:Awesome Aasim/noeditredlinks.js

Fix handling of red links to different wikis
In Village pump (technical) and in T345981, it was reported that this script breaks red links to different wikis, e.g. the links to non-existent user pages on Commons in file descriptions.

To fix this, instead of figuring out the link target yourself with  etc. (which will not work correctly if the   is not relative), you can ask the browser to do it with. The difference between these two methods is that  accesses the original HTML attributes, while   accesses the properties computed based on these attributes – here's a short post with more details about this and more examples of differences:

By the way, you can avoid duplicating the script code by combining the two selectors into.

Overall, I would suggest modifying the code as follows: Matma Rex talk 22:24, 9 September 2023 (UTC)


 * Quick Quokka [⁠talk • contribs] 09:43, 10 September 2023 (UTC)
 * ✅ thanks! Aasim - Herrscher of Wikis ❄️ 01:38, 11 September 2023 (UTC)