diff --git a/public/js/metadata.js b/public/js/metadata.js index fcf92c6..990ca40 100644 --- a/public/js/metadata.js +++ b/public/js/metadata.js @@ -246,7 +246,14 @@ var pageUpload = async function() { document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-metadata').classList.add('d-none'); document.getElementById('input_pdf_upload').focus(); - const cache = await caches.open('pdf'); + let cache; + try { + cache = await caches.open('pdf'); + } catch (e) { + console.error(e) + alert("Erreur d'accès au cache. Cette application ne fonctionne pas en mode de navigation privée"); + return; + } document.getElementById('input_pdf_upload').addEventListener('change', async function(event) { let filename = document.getElementById('input_pdf_upload').files[0].name; let response = new Response(document.getElementById('input_pdf_upload').files[0], { "status" : 200, "statusText" : "OK" }); diff --git a/public/js/organization.js b/public/js/organization.js index 669a980..524d3e2 100644 --- a/public/js/organization.js +++ b/public/js/organization.js @@ -740,7 +740,14 @@ var pageUpload = async function() { document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-organization').classList.add('d-none'); document.getElementById('input_pdf_upload').focus(); - const cache = await caches.open('pdf'); + let cache; + try { + cache = await caches.open('pdf'); + } catch (e) { + console.error(e) + alert("Erreur d'accès au cache. Cette application ne fonctionne pas en mode de navigation privée"); + return; + } document.getElementById('input_pdf_upload').addEventListener('change', async function(event) { if(document.getElementById('input_pdf_upload').files[0].size > maxSize) { diff --git a/public/js/signature.js b/public/js/signature.js index 71d4135..ab2f82b 100644 --- a/public/js/signature.js +++ b/public/js/signature.js @@ -996,7 +996,14 @@ var pageUpload = async function() { document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-signature').classList.add('d-none'); document.getElementById('input_pdf_upload').focus(); - const cache = await caches.open('pdf'); + let cache; + try { + cache = await caches.open('pdf'); + } catch (e) { + console.error(e) + alert("Erreur d'accès au cache. Cette application ne fonctionne pas en mode de navigation privée"); + return; + } document.getElementById('input_pdf_upload').addEventListener('change', async function(event) { if(document.getElementById('input_pdf_upload').files[0].size > maxSize) {