User:LinguisticMystic/common.js

$(document).ready(function {   // Find all redirect links    $('a.mw-redirect').each(function { var redirectLink = $(this).attr('href'); // Get the target page of the redirect $.ajax({           url: redirectLink,            type: 'HEAD',            success: function {                // If the target page exists, update the link to point directly to it                $(this).attr('href', redirectLink);            },            error: function {                // If the target page does not exist, do nothing            }        }); }); });