/* ==UserScript== // @name Adskeeper & Ideamedia → Chrome // @namespace local.ad.redirect // @version 1.0 // @description Redirect matching ad links to Chrome on Android // @match *://*/* // @run-at document-start // @grant none // ==/UserScript== */ (function () { "use strict"; const AD_HOSTS = [ "adskeeper.co.uk", "adskeeper.com", "ideamedia.com" ]; function isTargetAd(url) { try { const u = new URL(url); const host = u.hostname.toLowerCase(); return AD_HOSTS.some( domain => host === domain || host.endsWith("." + domain) ); } catch { return false; } } document.addEventListener("click", function (event) { const link = event.target.closest("a[href]"); if (!link || !isTargetAd(link.href)) return; // Let the browser handle the link normally. // JavaScript cannot directly launch Chrome on Android. console.log("Matched ad link:", link.href); }, true); })();