Greasy Fork

Greasy Fork is available in English.

Crunchyroll Video overlay visibility toggle

Adds an event listener on the letter `h` to toggle video overlay visibility

目前为 2023-11-04 提交的版本。查看 最新版本

// ==UserScript==
// @name         Crunchyroll Video overlay visibility toggle
// @namespace    http://greasyfork.icu/en/users/1210956-requiemofspirit
// @version      1.0.0
// @description  Adds an event listener on the letter `h` to toggle video overlay visibility
// @author       RequiemOfSpirit
// @homepage     https://github.com/RequiemOfSpirit
// @match        https://static.crunchyroll.com/vilos-*
// @license      MIT
// @icon         https://upload.wikimedia.org/wikipedia/commons/7/75/Cib-crunchyroll_%28CoreUI_Icons_v1.0.0%29_orange.svg
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('keyup', (e) => {
        const overlay = document.querySelector("#velocity-controls-package");
        if (e.key !== 'h' || overlay == undefined) {
            return;
        }

        overlay.style.opacity = (overlay.style.opacity === '0') ? 1 : 0;
    });
})();