// ==UserScript== // @require http://code.jquery.com/jquery-3.4.1.min.js // @name Youtube 字幕翻譯重疊修復(半自動) 、 字幕字形改微軟正黑體 // @namespace http://tampermonkey.net/ // @version 1.0 // @description try to take over the world! // @author You // @grant GM_addStyle // @include http*://*.youtube.com/* // @include http*://youtube.com/* // @include http*://*.youtu.be/* // @include http*://youtu.be/* // @downloadURL none // ==/UserScript== //字體更改 //font-family:字型清單 //font-weight:字型樣式 //webkit-text-stroke:字型外框 GM_addStyle(` .ytp-caption-segment{ font-family: "Microsoft JhengHei","Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive !important; font-weight: bold !important; -webkit-text-stroke: 1.5px black !important; } ` ); var $ = window.jQuery; 'use strict'; $(document).ready(function () { setInterval(CCFixs, 10); //檢查字幕重疊頻率(10ms) }); function CCFixs() { var temp1 = ["", ""]; $(".caption-window").each(function (index, element) { temp1[index] = $(this).attr('id').replace("caption-window-_", ""); }) if (parseInt(temp1[0]) > parseInt(temp1[1])) { $("#caption-window-_" + temp1[1]).remove(); } else if (parseInt(temp1[0]) < parseInt(temp1[1])) { $("#caption-window-_" + temp1[0]).remove(); } } function CCFix() { if ($(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom").length == 2) { $(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom")[0].remove(); } }