// ==UserScript== // @name Filmaffinity clickable search // @namespace https://github.com/antoniocambados // @version 0.1 // @description Makes new (2023) quick search results clickable // @author Antonio Cambados // @match https://www.filmaffinity.com* // @match https://www.filmaffinity.com/* // @grant none // @license GNU GPLv3 // @downloadURL none // ==/UserScript== /*jshint esversion: 6*/ (function() { 'use strict'; function makeMovieLink(movieId) { return `https://www.filmaffinity.com/es/film${movieId}.html`; } function makeNameLink(nameId) { return `https://www.filmaffinity.com/es/name.php?name-id=${nameId}`; } function makeTheaterLink(theaterId) { return `https://www.filmaffinity.com/es/theater-showtimes.php?id=${theaterId}` } function replaceMovieElement(element) { let movieId = element.getAttribute("data-movie-id"); if (movieId) { element.setAttribute("href", makeMovieLink(movieId)); element.outerHTML = element.outerHTML.replace(/^
$/g,"a>"); } } function replacePersonElement(element) { let nameId = element.getAttribute("data-name-id"); if (nameId) { element.setAttribute("href", makeNameLink(nameId)); element.outerHTML = element.outerHTML.replace(/^
$/g,"a>"); } } function replaceTheaterElement(element) { let theaterId = element.getAttribute("data-theater-id"); if (theaterId) { element.setAttribute("href", makeTheaterLink(theaterId)); element.outerHTML = element.outerHTML.replace(/^
$/g,"a>"); } } function process() { document.querySelectorAll(`div.movie-card-acf`).forEach(card => { replaceMovieElement(card); }); document.querySelectorAll(`div.name-ac`).forEach(card => { replacePersonElement(card); }); document.querySelectorAll(`div.theater-ac`).forEach(card => { replaceTheaterElement(card); }); } process(); setInterval(process, 300); })();