Skip to content

YouTube 字幕非表示 by hori68

Details

Authorhori68

LicenseCC-BY-4.0

CategoryYouTube

Created

Updated

Size2.4 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

字幕を強制的に非表示にします

Notes

CSS の has: を理解できない古いブラウザの場合、ホーム、登録ページ、検索ページの設定が効かず、常に字幕が表示されます。代わりに、設定の旧ブラウザ救済を必要に変えれば、ホーム、登録ページ、検索ページでまとめて字幕が非表示になります。

Source code

/* ==UserStyle==
@name           YouTube 字幕非表示
@namespace      userstyles.world/user/hori68
@version        1.1
@description    字幕を強制的に非表示にします
@author         hori68
@license        CC-BY-4.0
@preprocessor   stylus
@var select video       "通常動画の字幕"     ["NO:非表示","YES:表示"]
@var select short       "ショートの字幕"     ["NO:非表示","YES:表示"]
@var select home        "ホームの字幕"       ["NO:非表示","YES:表示"]
@var select subsc       "登録ページの字幕"   ["NO:非表示","YES:表示"]
@var select search      "検索ページの字幕"   ["NO:非表示","YES:表示"]
@var select save_old    "旧ブラウザ救済"     ["NO:不要","YES:必要"]
==/UserStyle== */

@-moz-document domain("youtube.com") {
    i = !important //
    if(video == "NO"){
        ytd-watch-flexy{
            div.caption-window{
                display:none i;
            }
        }
    }
    if(short == "NO"){
        ytd-shorts{
            div.caption-window{
                display:none i;
            }
        }
    }
    if(home == "NO"){
        div#content.ytd-app:has(ytd-browse[page-subtype="home"][role="main"])~div#video-preview{
            div.caption-window{
                display:none i;
            }
            div.ytInlinePlayerControlsTopRightControlsCircleButton:has(yt-closed-captions-toggle-button){
                display:none i;
            }
        }
    }
    if(search == "NO"){
        div#content.ytd-app:has(ytd-search[role="main"])~div#video-preview{
            div.caption-window{
                display:none i;
            }
            div.ytInlinePlayerControlsTopRightControlsCircleButton:has(yt-closed-captions-toggle-button){
                display:none i;
            }
        }
    }
    if(subsc == "NO"){
        div#content.ytd-app:has(ytd-browse[page-subtype="subscriptions"][role="main"])~div#video-preview{
            div.caption-window{
                display:none i;
            }
            div.ytInlinePlayerControlsTopRightControlsCircleButton:has(yt-closed-captions-toggle-button){
                display:none i;
            }
        }
    }
    if(save_old == "YES"){
        div#video-preview div.caption-window{
            display:none i;
        }
    }
}

Reviews

No reviews yet.