Youtube entancer of mine

Some of youtube entancer of mine

当前为 2020-05-15 提交的版本,查看 最新版本

// ==UserScript==
// @name         Youtube entancer of mine
// @namespace    http://www.chaochaogege.com
// @version      0.5
// @description  Some of youtube entancer of mine
// @author       You
// @match        https://www.youtube.com/watch?*
// @grant        none
// @require https://gf.qytechs.cn/scripts/402597-monitor-dom-change/code/monitor%20dom%20change.js?version=801281
// ==/UserScript==

!function () {
  const over = document.querySelector('body')
  const container = document.querySelector('.html5-video-player')
  let right = ''
  let left = ''
  let top = ''
  let bottom = ''
  // 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 =>{
      console.log(e)
      if (e.target.className.includes('ytp-caption-segment')) {
        e.stopPropagation()
      }
  },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 })
}()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址