Hacker News new | ask | show | jobs
by The_Founder 2167 days ago
Tiny enough to paste the whole thing here. Clever trick to insert a "." after the .com that seems to trick some of the ad targeting. Wonder how many other sites this works on?

chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {

    if (changeInfo.status === "loading" && /youtube.com/.test(changeInfo.url)) {

        let url = new URL(tab.url);
        if (!url.hostname.endsWith(".")) {

            url.hostname = url.hostname + ".";
            chrome.tabs.update(tabId, { url: url.href });
        }}})