message pour firefox
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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é"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user