URL.canParse dummy

URL.canParseがnullになってurlクリックできなくなるので

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         URL.canParse dummy
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  URL.canParseがnullになってurlクリックできなくなるので
// @author       You
// @match        https://www.nicovideo.jp/watch/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nicovideo.jp
// @grant        none
// @license MIT
// ==/UserScript==


window.autoHideControllerRetryCount = 0;

function AutoHideController()
{
    // 全画面表示してもコントローラーが消えないのを修正
    let fullScreenButton = document.querySelector('button[aria-label="全画面表示する"]');
    if (fullScreenButton) {
        fullScreenButton.addEventListener("click", ()=> {
            console.log("fullscreen clicked!");

            setTimeout(()=> {
                // 非表示になっていないコントローラー
                let controllerBar = document.querySelector('div[class*="op_100"]');
                if (controllerBar) {
                    console.log("コントローラーを非表示にします");

                    controllerBar.classList.remove("op_100");
                    controllerBar.classList.add("op_0");

                    let videoClickWindow = document.getElementById("nv_watch_VideoAdContainer");
                    videoClickWindow.parentElement.parentElement.addEventListener("click", ()=> {
                        console.log("コントローラーを表示する");
                        controllerBar.classList.remove("op_0");
                        controllerBar.classList.add("op_100");
                    }, { 'once': true });
                } else {
                    console.log("コントローラーは非表示済み");
                }
            }, 1000);

        });
    } else {
        console.log("fullScreenButton not found...");

        if (window.autoHideControllerRetryCount < 10) {
            window.autoHideControllerRetryCount++;
            setTimeout(AutoHideController, 1000);
        }
    }
}

(function() {
    'use strict';

    //alert("test!");

    if (!URL.canParse) {
        console.log("URL.canParse is null");

        URL.canParse = (url) => {
            console.log("URL.canParse : $(url)");
        }
    }
    AutoHideController();

    // Your code here...
})();