Greasy Fork

来自缓存

Greasy Fork is available in English.

Timvision Enhanced - Parte 2

Modifiche varie per migliorare l'interazione su timvision.it

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Timvision Enhanced - Parte 2
// @name:en      Timvision Enhanced - Part 2
// @namespace    http://cosoleto.free.fr
// @version      0.4
// @description  Modifiche varie per migliorare l'interazione su timvision.it
// @description:en  Miscellaneous improvements for timvision.it
// @author       Francesco Cosoleto
// @match        http*://www.timvision.it/*
// @exclude      http*://www.timvision.it/profile
// @exclude      http*://www.timvision.it/promo
// @exclude      http*://www.timvision.it/support
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const observer_target = document.querySelector("body");
    const observer_opts = {childList: true, subtree: true};

    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            for (let i = 0; i < mutation.addedNodes.length; i++) {
                let node = mutation.addedNodes[i];
                if (node.nodeName === "TIM-GRID-VIEW-ITEM") {
                    observer.disconnect();
                    let items = node.parentNode.querySelectorAll(".content-item-badge,.content-timbundle-badge");
                    items.forEach(function(e) {e = e.parentNode.parentNode.parentNode; node.parentNode.insertBefore(e, null) });
                    observer.observe(observer_target, observer_opts);
                    break;
                } else {
                    switch (node.nodeName) {
                        case "TIM-HEADER": {
                            let btn = document.createElement("li");
                            let dest = document.querySelector(".user-profile-link");
                            btn.innerText = "(+)";
                            btn.onclick = showOptions;
                            dest.parentNode.appendChild(btn);
                        }
                            break;
                        case "TIM-BOOKMARK-DIALOG":
                        case "TIM-CONTINUE-WATCHING-DIALOG":
                            node.querySelector("div.buttons-panel").firstElementChild.click();
                            break;
                        case "TIM-ADVANCED-INFO-MESSAGE-DIALOG":
                            if (node.innerText.startsWith("IL SIMBOLO VIOLA")) {
                                document.getElementsByClassName("cdk-overlay-container")[0].textContent = '';
                                document.firstElementChild.removeAttribute("class");
                                document.body.removeAttribute("class");
                            }
                    }
                }
            }
        }
                         );
    });
    observer.observe(observer_target, observer_opts);

function showOptions()
{
    alert("opzioni estensione presto disponibili");
}

})();