Greasy Fork is available in English.

Antispoiler for UEFA.tv

hide spoilers on UEFA.tv

2020/10/24時点のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Antispoiler for UEFA.tv
// @namespace    https://aoytsk.blog.jp/
// @version      0.1
// @license      MIT License (MIT) https://opensource.org/licenses/MIT
// @description  hide spoilers on UEFA.tv
// @author       aoytsk
// @match        https://www.uefa.tv/
// @match        https://www.uefa.tv/match/vod/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let router = {
        '/': ()=>{
            let id = setInterval(()=>{
                let list = document.querySelectorAll('h2.titled-section__title')
                if(list.length != 0) {
                    clearInterval(id)
                    list.forEach((el)=>{
                        if(el.firstElementChild.textContent.match(/MATCH RE-RUNS/)) {
                            let titles = el.nextElementSibling.querySelectorAll('h1.rail-slide__title > span')
                            console.log(titles)
                            titles.forEach((title)=>{
                            console.log(title)
                                title.textContent = title.textContent.replace(/\d+-\d+/gi, "vs")
                            })
                        }
                    })
                }
            }, 500)
        },
        '/match/vod': ()=>{
            let css = document.createElement('style')
            css.style.type = 'text/css'
            document.head.appendChild(css)

            // seek bar
            css.sheet.insertRule('.video-js .vjs-utv-timeline-control {display: none !important}')
            // activity
            css.sheet.insertRule('main > article + ol {display: none !important}')
        },
    }

    let path = location.pathname.replace(/\/\d+/gi, "")
    typeof router[path] === 'function' && router[path]()

})();