Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Old chat
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://www.twitch.tv/*
- // @grant none
- // @run-at document-idle
- // ==/UserScript==
- var oldChat = false;
- var chat;
- new MutationObserver(function(mutations) {
- if (!chat)
- chat = document.querySelector("div.chat__container.full-width.full-height.overflow-hidden.flex.flex-column.flex-grow-1.flex-shrink-1 > div");
- if (chat) {
- if (!oldChat) {
- chat.innerHTML = '<iframe src="' + window.location.href + '/chat?popout=" style="height: 100%;"></iframe>';
- oldChat = true;
- }
- if (chat.childElementCount !== 1) {
- for (let x = 1;x < chat.childElementCount;x++) {
- chat.children[x].remove();
- }
- }
- }
- }).observe(document, {childList: true, subtree: true});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement