fixed youtube captions

Some of youtube entancer of mine

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         fixed youtube captions
// @namespace    http://www.chaochaogege.com
// @version      0.9.1
// @description  Some of youtube entancer of mine
// @author       iamwwc
// @match        https://www.youtube.com/*
// @grant        none
// @require https://greasyfork.org/scripts/402597-monitor-dom-change/code/monitor%20dom%20change.js?version=801281
// @run-at document-end
// ==/UserScript==

!function youtubeofmine() {
  const over = document.querySelector('body')
  let container = document.querySelector('body')
  function start() {
    // const subtitlesdiv = document.querySelector('.caption-window')
    function addMultipleListener(target, events, fn, useCapture) {
      for (const e of events) {
        target.addEventListener(e, fn, useCapture)
      }
    }
    addMultipleListener(container, ['click', 'touchstart', 'mouseout', 'mousedown', 'mousemove'], e => {
      for (let idx = 0; idx < 5; idx++) {
        if (e.path[idx].className.includes('caption-window')) {
          e.stopPropagation()
          return
        }
      }
    }, true)
    monitordom(over, (lists) => {
      if (lists.addedNodes.length > 0) {
        const n = lists.addedNodes[0]
        if (typeof n.className == 'string') {
          if (n.className.includes('ytp-caption-segment')) {
            let stylelists = n.style
            stylelists['user-select'] = 'text'
          }
        }
      }
    }, { attributes: true, childList: true, subtree: true })
  }
  start()
}()