Skip to content

Commit

Permalink
add microphone only if https
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Jan 27, 2025
1 parent 89573fd commit a3b2960
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions js/microphone/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,21 @@ const unconfigureMicrophone = async () => {

export async function microphoneavailableConnect() {
let microphone=document.getElementById('microphone');
// is microphone is defined
if (microphone) {
launcher.isPulseAvailable().then(
// if page is secure
if ( document.location.protocol === 'https:' ) {
launcher.isPulseAvailable().then(
(res) => {
if (res.status === 200) {
microphone.style.display = 'block';
}
}
);
);
}
else {
console.log( document.location.protocol + ' is not secured \'https:\', microphone is disabled' );
}
}
}

Expand Down

0 comments on commit a3b2960

Please sign in to comment.