User:Yamaha5/ResolveAll.js

if (mw.config.get('wgCanonicalSpecialPageName') !== 'Search') { location.href = 'https://en.wikipedia.org/?limit=500&offset=0&ns0=1&ns14=1&search=insource%3A%2F%5C%5B%5C%5Bfa%3A%2F&withJS=User:Yamaha5/ResolveAll.js'; } $(function {  Array.from(document.querySelectorAll(".mw-search-result-heading a")).map(function (element) { var title = element.title; return function { return new Promise(function (resolve, reject) {       fetch('https://tools.wmflabs.org/dexbot/interwikidata_en.php?page=' + title).then(function (res) { return res.text; }).then(function (res) { mw.notify(title, res); resolve; }, reject);     }); }; })    .reduce(function (defer, job) { return defer.then(job); }, Promise.resolve)    .then(function  { mw.notify('finish!'); }); });