Created
October 7, 2016 20:43
-
-
Save nderscore/6a1e8e52dcf062aca305ba1e83f3c2da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.speechSynthesis && console.log.name !== 'talkLog') { | |
console.log = (log => function talkLog(){ | |
[...arguments].forEach(item => { | |
if (typeof item !== 'string') { | |
try { | |
item = `Object: ${JSON.stringify(item)}`; | |
} catch (e) { | |
item = ''; | |
} | |
} | |
speechSynthesis.speak(new SpeechSynthesisUtterance(item)); | |
}); | |
return log.apply(this, arguments); | |
})(console.log); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment