Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyohsuke/36737998a25e2ee5583ea4758c708ea7 to your computer and use it in GitHub Desktop.
Save kyohsuke/36737998a25e2ee5583ea4758c708ea7 to your computer and use it in GitHub Desktop.
Remove Twitch Recommended
// ==UserScript==
// @name Remove Twitch Front Page Recommended
// @namespace http://tampermonkey.net/
// @version 1.0.2
// @description twitch.tv のトップページにあるレコメンドを停止して削除するヤツ
// @author kyohsuke (based on dani12817's userscript)
// @downloadURL https://gist.github.com/kyohsuke/36737998a25e2ee5583ea4758c708ea7/raw/twitchRemoveFrontReco.user.js
// @updateURL https://gist.github.com/kyohsuke/36737998a25e2ee5583ea4758c708ea7/raw/twitchRemoveFrontReco.user.js
// @match https://www.twitch.tv/*
// @icon https://static.twitchcdn.net/assets/favicon-32-e29e246c157142c94346.png
// @grant none
// @run-at document-idle
// ==/UserScript==
// forked from dani12817 https://gist.github.com/dani12817/da23f381d69a55be7f3c9892369d5d0e
(function() {
'use strict';
let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
let claiming = false;
if (MutationObserver) console.log('Remove Twitch Front Page Recommended is enabled.');
let observer = new MutationObserver(e => {
function isFrontPage(currentURL) {
return currentURL == "https://www.twitch.tv" || currentURL == "https://www.twitch.tv/"
}
if(isFrontPage(document.URL)) {
for (let vtag of document.getElementsByTagName('video')) {
vtag.onplay = function() {
let frontCarousel = document.getElementsByClassName("front-page-carousel");
if (frontCarousel.length) {
vtag.pause();
console.log(frontCarousel[0]);
frontCarousel[0].remove();
}
};
}
}
});
observer.observe(document.body, {childList: true, subtree: true});
})();
// ==UserScript==
// @name Remove Twitch Sidebar Recommended
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Quita la sección de Recomendados de la barra lateral
// @author dani12817
// @match https://www.twitch.tv/*
// @icon https://static.twitchcdn.net/assets/favicon-32-e29e246c157142c94346.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log("Sidebar Recommended");
var sideInterval = setInterval(function () {
var sideSections = document.getElementsByClassName("side-nav-section");
if (sideSections.length) {
clearInterval(sideInterval);
sideSections[1].remove();
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment