Skip to content

Commit b91adea

Browse files
committed
Removed mimeType checks
None of the major browser vendors actively support navigator.mimeTypes. The oldest browser supported by PDFObject (IE11) uses ActiveX. Time to clean house.
1 parent 4f2454a commit b91adea

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pdfobject.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
if( typeof window === "undefined" ||
3232
window.navigator === undefined ||
33-
window.navigator.userAgent === undefined ||
34-
window.navigator.mimeTypes === undefined){
33+
window.navigator.userAgent === undefined){
3534
return false;
3635
}
3736

@@ -57,9 +56,6 @@
5756
*/
5857
let isModernBrowser = (window.Promise !== undefined);
5958

60-
//Older browsers still expose the mimeType
61-
let supportsPdfMimeType = (nav.mimeTypes["application/pdf"] !== undefined);
62-
6359
//Safari on iPadOS doesn't report as 'mobile' when requesting desktop site, yet still fails to embed PDFs
6460
let isSafariIOSDesktopMode = ( nav.platform !== undefined &&
6561
nav.platform === "MacIntel" &&
@@ -105,8 +101,6 @@
105101
isModernBrowser ||
106102
//Modern versions of Firefox come bundled with PDFJS
107103
isFirefoxWithPDFJS ||
108-
//Browsers that still support the original MIME type check
109-
supportsPdfMimeType ||
110104
//Pity the poor souls still using IE
111105
(isIE && supportsPdfActiveX())
112106
)

0 commit comments

Comments
 (0)