Forked from dani12817/twitchRemoveFrontReco.user.js
Last active
March 29, 2024 07:11
-
-
Save kyohsuke/36737998a25e2ee5583ea4758c708ea7 to your computer and use it in GitHub Desktop.
Remove Twitch Recommended
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 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}); | |
})(); |
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 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