URL.canParse dummy

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

As of 2024-10-19. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         URL.canParse dummy
// @namespace    http://tampermonkey.net/
// @version      0.1.0
// @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==


(function() {
    'use strict';

    //alert("test!");

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

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

    // 全画面表示してもコントローラーが消えないのを修正
    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");
                } else {
                    console.log("コントローラーは非表示済み");
                }
            }, 1000);

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



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