// ==UserScript== // @name Metacritic: IGGGAMES Search // @description Adds an igg-games.com search link to Metacritic game pages // @version 0.3 // @author mica // @namespace greasyfork.org/users/12559 // @match https://www.metacritic.com/* // @license MIT // @downloadURL none // ==/UserScript== function makeLink() { setTimeout(() => { var title = document.querySelector('.c-productHero_title > div').innerText; var link = 'https://igg-games.com/?s=' + encodeURIComponent(title); var html = `
`; document.querySelector('.c-productHero_scoreInfo').insertAdjacentHTML('beforebegin', html); }, 900) } var url; setInterval(() => { if (url != location.href) { url = location.href; if (location.pathname.match('\/game\/.') && document.querySelector('.c-gamePlatformLogo_icon.c-gamePlatformLogo_icon--PCLogo')) { makeLink(); } } }, 100)