Created
January 12, 2019 10:43
-
-
Save Marco3jp/e702d85dcd838ea5565f9f68d5fb77df to your computer and use it in GitHub Desktop.
You can enlarge video to the window size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name dtv in fullWindow | |
// @namespace https://marco.plus/ | |
// @version 0.1 | |
// @description You can enlarge video to the window size. | |
// @author Marco | |
// @match https://pc.video.dmkt-sp.jp/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
class DtvInFullWindow{ | |
constructor(){ | |
let insertLocation = document.querySelector(".fullscreen"); | |
let button = document.createElement("button"); | |
let buttonWrapper = document.createElement("div"); | |
button.textContent = "Fit Window"; | |
button.addEventListener("click",()=>{ | |
this.enlarge(document.querySelector(".titleDetailPlayer")); | |
}); | |
buttonWrapper.appendChild(button); | |
insertLocation.insertAdjacentElement('beforebegin',buttonWrapper); | |
} | |
enlarge(elm){ | |
elm.style.width="100%"; | |
} | |
} | |
let elm = document.querySelector(".actionOverlayContentIcon--play"); | |
if(elm !== null){ | |
elm.addEventListener("click",()=>{ | |
let intervalId = setInterval(()=>{ | |
if(document.querySelector(".fullscreen")!==null){ | |
clearInterval(intervalId); | |
let dtvInFullWindow = new DtvInFullWindow(); | |
} | |
},500); | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
【既知のバグ】