Hide Booking.com ad on Trainline

Uncheck booking.com search on Trainline, and hide the ad

// ==UserScript==
// @match            https://www.thetrainline.com/*
// @name             Hide Booking.com ad on Trainline
// @description      Uncheck booking.com search on Trainline, and hide the ad
// @name:fr          Trainline : cacher la publicité pour Booking.com
// @description:fr   Décoche la recherche booking.com sur Trainline et cache la publicité
// @namespace        bohwaz
// @version          1.0
// @author           bohwaz
// @license          AGPL-3.0-or-later
// ==/UserScript==

(new MutationObserver(check)).observe(document, {childList: true, subtree: true});

function check(changes, observer) {
    let c;
    if ((c = document.getElementById('bookingPromo')) && c.checked) {
        c.click();
        c.parentNode.parentNode.parentNode.style.visibility = 'hidden';
    }
}
长期地址
遇到问题?请前往 GitHub 提 Issues。