message pour firefox

This commit is contained in:
2026-03-27 01:55:18 +01:00
parent de5758a123
commit 04c7ac4142
3 changed files with 34 additions and 23 deletions

View File

@@ -16,7 +16,7 @@
<header> <header>
<div style="display: flex; gap: 10px; align-items: center;"> <div style="display: flex; gap: 10px; align-items: center;">
<button class="stop-all" onclick="stopAll()">🛑 STOP ALL</button> <button class="stop-all" onclick="stopAll()">🛑 STOP ALL</button>
<span id="app-version" style="color: #555; font-size: 0.8rem; margin-left: 10px;">v1.201</span> <span id="app-version" style="color: #555; font-size: 0.8rem; margin-left: 10px;">v1.203</span>
<button id="installBtn" style="display:none; ...">📥 INSTALLER</button> <button id="installBtn" style="display:none; ...">📥 INSTALLER</button>
</div> </div>

View File

@@ -4,6 +4,7 @@
let deferredPrompt; let deferredPrompt;
const installBtn = document.getElementById('installBtn'); const installBtn = document.getElementById('installBtn');
const isFirefox = typeof InstallTrigger !== 'undefined';
window.addEventListener('beforeinstallprompt', (e) => { window.addEventListener('beforeinstallprompt', (e) => {
// Empêche Chrome d'afficher sa propre mini-barre // Empêche Chrome d'afficher sa propre mini-barre
@@ -27,6 +28,15 @@
}); });
}); });
if (isFirefox && !window.matchMedia('(display-mode: standalone)').matches) {
// On peut par exemple afficher un petit texte dans le header
const infoZone = document.getElementById('app-version'); // On utilise la zone de version
if (infoZone) {
infoZone.innerHTML += " <br><small>(Install. non dispo sur Firefox PC)</small>";
infoZone.style.color = "#ff8800"; // Orange pour attirer l'oeil gentiment
}
}
// Cache le bouton si l'app est déjà installée // Cache le bouton si l'app est déjà installée
window.addEventListener('appinstalled', () => { window.addEventListener('appinstalled', () => {
installBtn.style.display = 'none'; installBtn.style.display = 'none';
@@ -199,3 +209,4 @@
navigator.serviceWorker.register('sw.js') navigator.serviceWorker.register('sw.js')
.then(() => console.log("Service Worker Enregistré")); .then(() => console.log("Service Worker Enregistré"));
} }

View File

@@ -1,4 +1,4 @@
const CACHE_NAME = 'sb-v1.201'; // Change ce numéro pour forcer une mise à jour globale const CACHE_NAME = 'sb-v1.203'; // Change ce numéro pour forcer une mise à jour globale
const ASSETS = [ const ASSETS = [
'./', // Racine './', // Racine
'./index.html', './index.html',