Created
April 17, 2021 16:58
-
-
Save easrng/75c6150073eedb3e963eaff2961b0a9b 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
async function chromiumVendor(){ | |
let chromium=navigator.userAgent.includes("Chrom") | |
if(!chromium) return null | |
if(navigator.userAgent.includes("Edg")) return "microsoft" | |
if(navigator.brave) return "brave" | |
let google=await new Promise(cb=>{ | |
let ae=false; | |
function ov(){ | |
cb(speechSynthesis.getVoices().filter(e=>e.name.includes("Google")).length!=0) | |
if(ae) speechSynthesis.removeEventListener("voiceschanged", ov) | |
} | |
if(speechSynthesis.getVoices().length==0) { | |
ae=true | |
speechSynthesis.addEventListener("voiceschanged", ov) | |
} else ov() | |
}) | |
if(google) return "google" | |
return "other" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment