I am using these icons fonts of Google: https://material.io/icons/
I am developing a web extension and some web pages like Github is blocking my icons, I am trying to check with vanilla js if the font is available or not, the problem here is that I don't know when I need to confirm if the font was loaded or not.
I am using a setTimeOut but I really hate this method.
My code:
function confirmFont(view) {
setTimeout(function(){
if(!document.fonts.check("12px Material-Icons")) {
.....
}
}, 2000);
}
I tried with document ready and window load but this is not working I need to be more specific.