Skip to content

Instantly share code, notes, and snippets.

@sonictruth
Last active September 13, 2017 13:46
Show Gist options
  • Save sonictruth/7c2fea6d53818cbf92c24f81a722b9e2 to your computer and use it in GitHub Desktop.
Save sonictruth/7c2fea6d53818cbf92c24f81a722b9e2 to your computer and use it in GitHub Desktop.
// Talking console
//
// Support: http://caniuse.com/#search=SpeechSynthesisUtterance
//
// Copy paste the code into dev console or
// use http://mrcoles.com/bookmarklet/ to create a bookmarklet.
/* ✂️ ......................................................................................... */
if(console.log.name !== 'talkLog') {
console.l = console.log;
console.log = function talkLog(){
Array.prototype.forEach.call(arguments, function(a){
if(typeof a !== 'string')
try { a = 'Object: ' + JSON.stringify(a); } catch (e) {}
window.speechSynthesis.speak(new SpeechSynthesisUtterance(a));
});
console.l.apply(this, arguments);
}
}
console.log("I'm ready master! Let's debug", window.location.hostname);
/* ✂️ ......................................................................................... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment