Skip to content

Instantly share code, notes, and snippets.

@inonote
Last active August 29, 2020 08:38
Show Gist options
  • Select an option

  • Save inonote/e0bf6c4a8fa40999d7b81c7d68600ec0 to your computer and use it in GitHub Desktop.

Select an option

Save inonote/e0bf6c4a8fa40999d7b81c7d68600ec0 to your computer and use it in GitHub Desktop.
dアニメストアを便利にするスクリプト
// ==UserScript==
// @name Good dAnimeStore
// @namespace https://inonote.jp/
// @version 0.2
// @description dアニメストアを便利にするスクリプト。
// @author inonote
// @match https://anime.dmkt-sp.jp/animestore/sc_d_pc*
// @grant none
// ==/UserScript==
(function(doc) {
// タイトルバーを今見ているアニメの題名に変更
const observer = new MutationObserver(function(){
doc.title = doc.getElementsByClassName("pauseInfoTxt1")[0].innerText+" "+
doc.getElementsByClassName("pauseInfoTxt2")[0].innerText+
" - dアニメストア";
});
observer.observe(doc.getElementById("backThumb"), { attributes: true });
// 画質を具体的な表現に
(function(elms){
for(let i = 0; i < elms.length; i++){
elms[i].classList.toggle("w6", false);
elms[i].classList.toggle("w1", false);
elms[i].classList.toggle("w3", true);
if (elms[i].classList.contains("normal")){elms[i].innerHTML = "240p";}
else if (elms[i].classList.contains("good")){elms[i].innerHTML = "360p";}
if (elms[i].classList.contains("high")){elms[i].innerHTML = "480p";}
if (elms[i].classList.contains("hd")){elms[i].innerHTML = "720p";}
}
})(doc.querySelector("#imageQuality").children);
// 制御領域の高さが無駄に高いので、低く(小さく)
doc.getElementsByClassName("buttonArea")[0].style.zoom = 0.84;
doc.getElementById("volumePopup").style.zoom = 1.19048;
doc.getElementsByClassName("seekArea")[0].style.bottom = "42px";
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment