Last active
April 14, 2018 19:05
-
-
Save IMcPwn/f014188dad9e7f52ea7fac81941d51f3 to your computer and use it in GitHub Desktop.
better-crunchyroll.user.js
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 Better Crunchyroll | |
// @namespace https://carletonstuberg.com | |
// @description Hide Crunchyroll thumbnails, descriptions on queue, show oldest videos first | |
// @version 1.0.0 | |
// @author Carleton Stuberg | |
// @copyright 2016+, Carleton Stuberg | |
// @license MIT; http://opensource.org/licenses/MIT | |
// @include http://www.crunchyroll.com/* | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== | |
//==[ History ]====================================================== | |
// 1.0.0 - Initial release. | |
//=================================================================== | |
//------------------------------------------------------------------- | |
// main() - Runs after page is done loading. | |
//------------------------------------------------------------------- | |
function main() { | |
// remove show discussion link | |
if (document.getElementById('main_tab_discussions')) { | |
console.log('%c remove show discussion link'); | |
document.getElementById('main_tab_discussions').remove(); | |
}; | |
// remove all textareas (for comments) | |
var textareaList = document.getElementsByTagName('textarea'); | |
for (var i = 0; i < textareaList.length; i++) { | |
console.log('%c removing textarea'); | |
textareaList[i].remove(); | |
} | |
// remove comments section | |
var commentsList = document.getElementsByClassName('comments'); | |
for(var i = 0; i < commentsList.length; i++) { | |
console.log('%c removing comments'); | |
commentsList[i].remove(); | |
} | |
// hide thumbnails at the bottom of the video page | |
for (var thumb of document.querySelectorAll('.mug')) { | |
thumb.src = ''; | |
} | |
// hide short description (on queue page) | |
for (var descrip of document.querySelectorAll('.short-desc')) { | |
descrip.parentNode.removeChild(descrip); | |
} | |
// show oldest videos first | |
if (document.getElementById('subtabs_videos_oldest')) { | |
document.getElementById('subtabs_videos_oldest').click(function(e) { | |
e.preventDefault(); | |
}); | |
} | |
} | |
//------------------------------------------------------------------- | |
// Run main() upon load. | |
//------------------------------------------------------------------- | |
if (document.readyState === 'complete') | |
main(); | |
else | |
window.addEventListener("load", main, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment