Skip to content

Instantly share code, notes, and snippets.

View kimitaka's full-sized avatar
🗾
Working in Japan

Kimitaka Watanabe kimitaka

🗾
Working in Japan
View GitHub Profile
window.addEventListener('message', function(e) {
const data = e.data || {};
if (data.type !== 'item')
return;
const message = data.message || {};
const obj = { detail: { command: message.command, body: message.body, from: message.from }};
const synth = window.speechSynthesis;
if (obj.detail.command === 'PRIVMSG') {
var utter = new SpeechSynthesisUtterance(obj.detail.body);