Last active
April 16, 2021 23:04
-
-
Save onemenzel/ff8d32df86fd0de5d99ce0e594f14691 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 Speakchat - skribbl.io | |
// @namespace Violentmonkey Scripts | |
// @match https://skribbl.io/ | |
// @grant none | |
// @version 1.0 | |
// @author Lukas Menzel @onemenzel | |
// @description 17.4.2021, 00:47:36 | |
// ==/UserScript== | |
(() => { | |
let o = new MutationObserver((muts, observer) => { | |
let text = muts[0].addedNodes[0].getElementsByTagName('span')[0].innerHTML | |
let utterance = new SpeechSynthesisUtterance(text) | |
utterance.lang = 'de-DE' | |
speechSynthesis.speak(utterance) | |
}) | |
let node = document.getElementById('boxMessages') | |
o.observe(node, {childList: true}) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment