ब्राउज़र में एक्रोबेट प्लगइन की उपस्थिति का निर्धारण

प्लगइन की उपलब्धता का निर्धारण करने की समस्या का सामना करना पड़ा। Googling ने तुरंत परिणाम नहीं दिया। पांचवीं पंक्ति में मुख्य समस्या थी।
 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/In13953/


All Articles