Important: The following answer only applies to a specific time period.
Microsoft Edge, as suggested above, comes with built-in support for viewing PDF files. I do not think that there are any versions of Edge that do not have this feature, but if they are, they will be very rare.
In the near future, we plan to update navigator.mimeType , which will lead to the fact that your current approach (as presented above) will start working. Until then, I would like to urge you (I feel terrible for that), sniffing the user-agent string.
This issue will be resolved in a future Microsoft Edge update.
source share