Trainline for travel, not accomodation

Uncheck booking.com search on Trainline

< Opiniones de Trainline for travel, not accomodation

Puntuación: Malo; el script no funciona

§
Publicado: 11/09/2024

Doesn't work anymore, Trainline is checking the box multiple times during page load...

Here is my fix:

(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';
    }
}

Publicar respuesta

Inicia sesión para responder.

长期地址
遇到问题?请前往 GitHub 提 Issues。