1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Message to inform that in private browsing mode (on firefox) the application does not work because opening the cache is impossible

This commit is contained in:
Étienne Deparis 2023-05-03 01:34:07 +02:00 committed by Vincent LAURENT
parent 30e7ffef89
commit a1509a554f
3 changed files with 24 additions and 3 deletions

View File

@ -246,7 +246,14 @@ var pageUpload = async function() {
document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-upload').classList.remove('d-none');
document.getElementById('page-metadata').classList.add('d-none'); document.getElementById('page-metadata').classList.add('d-none');
document.getElementById('input_pdf_upload').focus(); 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) { document.getElementById('input_pdf_upload').addEventListener('change', async function(event) {
let filename = document.getElementById('input_pdf_upload').files[0].name; 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" }); let response = new Response(document.getElementById('input_pdf_upload').files[0], { "status" : 200, "statusText" : "OK" });

View File

@ -740,7 +740,14 @@ var pageUpload = async function() {
document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-upload').classList.remove('d-none');
document.getElementById('page-organization').classList.add('d-none'); document.getElementById('page-organization').classList.add('d-none');
document.getElementById('input_pdf_upload').focus(); 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) { document.getElementById('input_pdf_upload').addEventListener('change', async function(event) {
if(document.getElementById('input_pdf_upload').files[0].size > maxSize) { if(document.getElementById('input_pdf_upload').files[0].size > maxSize) {

View File

@ -996,7 +996,14 @@ var pageUpload = async function() {
document.getElementById('page-upload').classList.remove('d-none'); document.getElementById('page-upload').classList.remove('d-none');
document.getElementById('page-signature').classList.add('d-none'); document.getElementById('page-signature').classList.add('d-none');
document.getElementById('input_pdf_upload').focus(); 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) { document.getElementById('input_pdf_upload').addEventListener('change', async function(event) {
if(document.getElementById('input_pdf_upload').files[0].size > maxSize) { if(document.getElementById('input_pdf_upload').files[0].size > maxSize) {