Skip to content

Instantly share code, notes, and snippets.

@Marco3jp
Created January 12, 2019 10:43
Show Gist options
  • Save Marco3jp/e702d85dcd838ea5565f9f68d5fb77df to your computer and use it in GitHub Desktop.
Save Marco3jp/e702d85dcd838ea5565f9f68d5fb77df to your computer and use it in GitHub Desktop.
You can enlarge video to the window size
// ==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);
});
}
})();
@Marco3jp
Copy link
Author

【既知のバグ】

  • 体感3~4割くらいで何故か動かない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment