📜 ⬆️ ⬇️

Detecting Acrobat Plugin in Browser

Faced the problem of determining the presence of a plugin. Googleplay did not give results immediately. The main problem was in the fifth line.
 var isPDFInstalled = false; if (window.ActiveXObject) { var control; try { control = new ActiveXObject('AcroPDF.PDF'); } catch (e) { } if (!control) { try { control = new ActiveXObject('PDF.PdfCtrl'); } catch (e) { } } if (control) { isPDFInstalled = true; } } else { isPDFInstalled = navigator.mimeTypes && navigator.mimeTypes["application/pdf"]; } if (isPDFInstalled) { document.write('okay'); //   -  } else { document.write('shit'); //   -  } 

')

Source: https://habr.com/ru/post/13953/


All Articles