From 51891a5f6a96e81e24254129217c258d67e0772d Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Wed, 2 Oct 2024 13:00:17 +0200 Subject: [PATCH] DocumentLoaded --- public/js/metadata.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/metadata.js b/public/js/metadata.js index 10294b2..0b77d72 100644 --- a/public/js/metadata.js +++ b/public/js/metadata.js @@ -238,7 +238,8 @@ async function pageMetadata(url) { loadPDF(document.getElementById('input_pdf_upload').files[0]); }; -(function () { + +document.addEventListener('DOMContentLoaded', function () { if(window.location.hash && window.location.hash.match(/^\#http/)) { pageMetadata(window.location.hash.replace(/^\#/, '')); } else if(window.location.hash && window.location.hash.match(/^\#local/)) { @@ -252,4 +253,4 @@ async function pageMetadata(url) { window.addEventListener('hashchange', function() { window.location.reload(); }) -})(); +});