Created
February 25, 2016 02:14
-
-
Save panphora/08a96ae76d0be51f9371 to your computer and use it in GitHub Desktop.
Slow down twitch chat
This file contains hidden or 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
// INSTRUCTIONS | |
// 1. paste in Google Chrome dev console | |
// 2. enjoy! | |
// don't display any chat messages by default | |
var style = document.createElement("style"); | |
style.appendChild(document.createTextNode("")); | |
document.head.appendChild(style); | |
style.sheet.insertRule("body .ember-chat .chat-messages .chat-line {display: none;}", 0); | |
// every second (1000ms), show the last chat message | |
setInterval(function () { | |
var allChatLines = Array.from(document.querySelectorAll('.ember-chat .chat-messages .chat-line')); | |
var lastChatLine = allChatLines[allChatLines.length - 1]; | |
lastChatLine.style.display = 'block'; | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment