Can modernizer detect whether or not the browser has a pdf plugin installed and enabled? I’m displaying a pdf in an iframe in a web application. I remove the iframe from the dom clientside when a pdf plugin isnt present. I’m using a bit of clunky javascript to do the detection and would like to replace it with something more robust/standard and came across modernizr. Anyone know if this is possible?
Share
Looking at Modernizr docs I didn’t see any way to detect for pdf plugins, but you can check the mimeTypes the browser can handle. Writting it as a Modernizr test, you could do something like:
You should then be able to detect if the browser has a pdf plugin by the value of
Modernizr.pdf