function PDFPreviewSupport() {
  let showpreview = false;

  // Safari and Chrome have application/pdf in navigator.mimeTypes
  if (navigator.mimeTypes['application/pdf'] !== undefined) { showpreview = true; }

  // Firefox desktop uses pdf.js, but not mobile or tablet
  if (navigator.userAgent.indexOf('Firefox') !== -1) {
    if ((navigator.userAgent.indexOf('Mobile') === -1) && (navigator.userAgent.indexOf('Tablet') === -1)) { showpreview = true; }
    else { showpreview = false; } // have to reset it, as FF Mobile application/pdf listed, but not supported (wtf?)
  }

  return showpreview;
}
// Detect if there is PDF support for the autopreview
Detect if there is PDF support for the autopreview
Detect if there is PDF support for the autopreview
function PDFPreviewSupport() {
  let showpreview = false;
  if (navigator.mimeTypes['application/pdf'] !== undefined) { showpreview = true; }
  if (navigator.userAgent.indexOf('Firefox') !== -1) {
    if ((navigator.userAgent.indexOf('Mobile') === -1) && (navigator.userAgent.indexOf('Tablet') === -1)) { showpreview = true; }
    else { showpreview = false; } 
  }
  return showpreview;
}
function PDFPreviewSupport ( ) { let showpreview = false ; if ( navigator . mimeTypes [ 'application/pdf' ] !== undefined ) { showpreview = true ; } if ( navigator . userAgent . indexOf ( 'Firefox' ) !== - 1 ) { if ( ( navigator . userAgent . indexOf ( 'Mobile' ) === - 1 ) && ( navigator . userAgent . indexOf ( 'Tablet' ) === - 1 ) ) { showpreview = true ; } else { showpreview = false ; } } return showpreview ; }
Detect if there is PDF support for the autopreview
Detect if there is PDF support for the autopreview
// Safari and Chrome have application/pdf in navigator.mimeTypes // Firefox desktop uses pdf.js, but not mobile or tablet // have to reset it, as FF Mobile application/pdf listed, but not supported (wtf?)