function isChromium() { //return navigator.userAgentData && navigator.userAgentData.brands.some(data => data.brand == 'Chromium'); return typeof chrome !== 'undefined'; } if (! isChromium()) { document.querySelectorAll("button").forEach((e) => { if (e.innerText == "HT J2K") e.disabled = true; }); } function load_pdf(iframe_id, pdf_uri, callback) { const xhr = new XMLHttpRequest(); const pdfFrame = document.getElementById(iframe_id); const btn = this; btn.disabled = true; pdfFrame.src = "data:text/html,Fetching"; xhr.onload = function () { pdfFrame.onload = () => btn.disabled = false; pdfFrame.src = URL.createObjectURL(xhr.response); } xhr.responseType = "blob"; xhr.onerror = (ev) => console.log(ev); xhr.open('GET', pdf_uri); xhr.send(null); };