Created
February 20, 2024 13:33
-
-
Save Jacobboogiebear/a9683dc934c9ac07ab318b6df9b8f1e0 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name MultiTwitch Bigger Chat | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-02-20 | |
// @description Easily make chat window bigger in MultiTwitch | |
// @author Jacob Allen Morris | |
// @match https://www.multitwitch.tv/** | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=multitwitch.tv | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let chat = document.getElementById("chatbox"); | |
const splitAt = (index, xs) => [xs.slice(0, index), xs.slice(index)]; | |
let size = prompt("Width in pixels for chat", "500"); | |
if (parseInt(size) === NaN) { | |
alert("Invalid size value"); | |
} else { | |
setInterval(() => { | |
let attr = chat.getAttribute("style"); | |
let width_index = attr.search(/width: \d*px;/); | |
let pixel_value = splitAt(width_index + 7, attr)[1]; | |
let semi_index = pixel_value.search(/px;/); | |
let pixels = splitAt(semi_index, pixel_value)[0]; | |
if (pixels != 500) { | |
chat.setAttribute("style", `width: ${parseInt(size)}px;`); | |
} | |
}, 100); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment