Skip to content

Instantly share code, notes, and snippets.

@Ajido
Last active January 8, 2017 11:58
Show Gist options
  • Save Ajido/5fc7a5d0894eb3162c8d19a9652b4b66 to your computer and use it in GitHub Desktop.
Save Ajido/5fc7a5d0894eb3162c8d19a9652b4b66 to your computer and use it in GitHub Desktop.
TweetDeckにデスクトップ通知の内容を喋らせる + 通知音変更
Notification.prototype.__defineSetter__('onshow', function(callback) {
setTimeout(() => this.close(), 8000);
var speech = new SpeechSynthesisUtterance(this.body.replace(/@[a-z_]+\s?/gi, ''));
speech.lang = 'ja-JP';
speech.voice = 'Kyoko';
speechSynthesis.speak(speech);
});
$$('#update-sound source').forEach((audio) => {
// https://notificationsounds.com/terms-of-use
audio.setAttribute('src', 'https://notificationsounds.com/message-tones/all-eyes-on-me-465/download/mp3');
});
$("#update-sound").load();
@Ajido
Copy link
Author

Ajido commented Jan 7, 2017

TODO

  • 通知closeの秒数を文字数によって変える

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment