Some of youtube entancer of mine
当前为
// ==UserScript==
// @name Youtube entancer of mine
// @namespace http://www.chaochaogege.com
// @version 0.4
// @description Some of youtube entancer of mine
// @author You
// @match https://www.youtube.com/watch?*
// @grant none
// @require https://greasyfork.org/scripts/402597-monitor-dom-change/code/monitor%20dom%20change.js?version=801281
// ==/UserScript==
!function() {
const over = document.querySelector('body')
const player = document.querySelector('.html5-video-player')
let right = ''
let left = ''
let top = ''
let bottom = ''
// const subtitlesdiv = document.querySelector('.caption-window')
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'
}else if (n.className.includes('caption-window')){
let newCloned = n.cloneNode(true)
lists.addedNodes[0] = newCloned
}
}
}
},{attributes: true, childList: true, subtree: true})
}()