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