navigator.mediaDevices.getUserMedia({ audio: true }) .then(s => { s.getTracks().forEach(t => t.stop()); document.body.append(" granted."); }) .catch(e => document.body.append(" " + e));