diff --git a/assets/main.js b/assets/main.js index 235899e..ee13bf9 100644 --- a/assets/main.js +++ b/assets/main.js @@ -1,7 +1,10 @@ -const pdfPreview = document.querySelector("iframe"); +(function fixPdfOverflow() { + const pdfPreview = document.querySelector("iframe"); -if (pdfPreview) { - pdfPreview.onload = function () { - pdfPreview.contentWindow.document.body.style.overflow = "hidden"; - }; -} + if (!pdfPreview) { + return; + } + pdfPreview.onload = function () { + pdfPreview.contentWindow.document.body.style.overflow = "hidden"; + }; +})();