Greasy Fork is available in English.

Remover Chat da Twitch

remove todas as mensagens do chat da Twitch em um clique

// ==UserScript==
// @name      Remover Chat da Twitch
// @name:en   Remove Twitch Chat
// @version      1.5.2
// @description  remove todas as mensagens do chat da Twitch em um clique
// @description:en  remove all twitch chat messages in a click
// @author       raianwz
// @icon         https://i.imgur.com/E0el9Xh.png
// @match        https://www.twitch.tv/*
// @exclude      *://*.twitch.tv/moderator/*
// @namespace    https://greasyfork.org/users/425245
// @license MIT
// ==/UserScript==
var url = window.location.href
var position = ['down','up']
setTimeout(function(){

if(url.includes('twitch.tv/popout/') || url.includes('twitch.tv/embed/')){
        let where = document.querySelector('div.tw-align-content-center.tw-align-items-center.tw-flex.tw-flex-row')
        let start = "afterbegin"
		setTimeout(()=> createTrash(start, where, 1), 5000)
}else{
    let where = document.querySelector('.top-nav__prime')
	let start = "beforeBegin"
	createTrash(start, where, 0)
}

function checkLang(){
    let btnName = "?"
    let lang = document.documentElement.lang != "pt-BR"? btnName = "Remove Chat" : btnName = "Remover Chat"
    return btnName
}

function createTrash(start,where,i){
    let trash = `<div class="tw-mg-l-05 btn-remove">
<div data-test-selector="toggle-balloon-wrapper__mouse-enter-detector" style="display: inherit;">
<div class="tw-inline-flex tw-relative tw-tooltip-wrapper">
<button class="tw-align-items-center tw-align-middle tw-border-bottom-left-radius-medium tw-border-bottom-right-radius-medium tw-border-top-left-radius-medium tw-border-top-right-radius-medium tw-button-icon tw-core-button tw-inline-flex tw-interactive tw-justify-content-center tw-overflow-hidden tw-relative">
<div class="tw-align-items-center tw-core-button-label tw-flex tw-flex-grow-0" id="bremove"><figure class="tw-svg"><svg class="tw-svg__asset tw-svg__asset--inherit tw-svg__asset--trash" width="20px" height="20px" version="1.1" viewBox="0 0 20 20" x="0px" y="0px">
<g><path d="M12 2H8v1H3v2h14V3h-5V2zM4 7v9a2 2 0 002 2h8a2 2 0 002-2V7h-2v9H6V7H4z"></path><path d="M11 7H9v7h2V7z"></path></g></svg></figure></div></button>
<div class="tw-tooltip tw-tooltip--align-center tw-tooltip--${position[i]}" data-a-target="tw-tooltip-label" role="tooltip" id="brNome">${btnName = checkLang()}</div>
</div></div></div>`
	where.insertAdjacentHTML(`${start}`,`${trash}`)
	document.querySelector('#bremove').addEventListener("click", () => document.querySelector('.chat-scrollable-area__message-container').remove())
}
},10000)