Skip to content

Instantly share code, notes, and snippets.

@kijuky
Last active June 28, 2020 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kijuky/053c7988684f55bf7f0e7c3ddb50cf9b to your computer and use it in GitHub Desktop.
Save kijuky/053c7988684f55bf7f0e7c3ddb50cf9b to your computer and use it in GitHub Desktop.
Speech Slack Bookmarklet
javascript:speechSynthesis.cancel();if(typeof%20_speechslackobserver!=="undefined")_speechslackobserver.disconnect();_speechslackobserver=new%20MutationObserver(rs=>{r=rs[rs.length-1];if(r.nextSibling)return;r.addedNodes.forEach(n=>{if(n.ariaExpanded!=="false")return;m=/:\d\d(.+)/gs.exec(n.textContent);if(m){speechSynthesis.speak(new%20SpeechSynthesisUtterance(m[1]))}})}).observe(document.querySelectorAll(".c-virtual_list__scroll_container")[1],{subtree:true,childList:true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment