Skip to content

Instantly share code, notes, and snippets.

@7kry
Created May 26, 2020 14:00
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 7kry/503eeac1eac10de1038e7a50eec7e22e to your computer and use it in GitHub Desktop.
Save 7kry/503eeac1eac10de1038e7a50eec7e22e to your computer and use it in GitHub Desktop.
javascript: !(function() { var observer = new MutationObserver(function(MutationRecords, MutationObserver) { for (var i = 0; i < MutationRecords.length; ++i) { MutationRecords[i].addedNodes.forEach(function(elem) { console.log(elem); var msg = new SpeechSynthesisUtterance; var voices = window.speechSynthesis.getVoices(); msg.text = $(elem).find(".tw-comment-item-comment").text(); msg.lang = "ja-JP"; speechSynthesis.speak(msg) }) } }); observer.observe($(".tw-comment-list-view__scroller > div").get(0), { childList: true }) })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment