User:Proteins/listredirectstothispage.js

// // List pages that redirect to this one // // To use this script, add "importScript('User:Proteins/listredirectstothispage.js');" to your monobook.js subpage // under your user page, as you can see at User:Proteins/monobook.js

function listRedirectsToThisPage {

var api_query; var page_name; var article_name;

page_name = wgPageName; article_name = (wgNamespaceNumber == 1) ? page_name.substr(5) : page_name; article_name = URLEncode(article_name);

api_query = "http://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle="+article_name+"&bllimit=500&blfilterredir=redirects";

window.open(api_query); } // closes listRedirectsToThisPage

addOnloadHook(function { mw.util.addPortletLink('p-navigation', 'javascript:listRedirectsToThisPage', 'List redirects', 'ca-redirects', 'List pages that redirect to this page', '=', ''); }); //