Fix: CSP worker-src 'self' blob: (SW-Registrierung war durch blob:-only blockiert) + Vektor-Basemap auf Staging default-an

- worker-src blob: hatte sw.js (same-origin) blockiert → SW-Registrierung schlug app-weit fehl
  → alter SW servierte stale ui.js → UI.map.vectorLayer undefined → stiller Raster-Fallback
- _vectorMapEnabled: Staging default AN (Reifephase), Prod AUS bis Freigabe, Flag überschreibt
This commit is contained in:
rene 2026-06-05 08:52:36 +02:00
parent 736c326635
commit b0fece16c8
7 changed files with 24 additions and 19 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1176'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1177'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator)
window.APP_VERSION = APP_VERSION;

View file

@ -869,14 +869,19 @@ const UI = (() => {
return _protomapsPromise;
}
// Feature-Flag: localStorage 'by_vector_map'==='1'. ?vectormap=1/0 setzt ihn (Testing).
// Feature-Flag Vektor-Basemap: ?vectormap=1/0 setzt localStorage 'by_vector_map'.
// Default: auf Staging AN (Reifephase), auf Produktion AUS bis zur Freigabe.
// Explizit überschreibbar per Flag (1=an, 0=aus) — gilt auch in der installierten PWA.
function _vectorMapEnabled() {
try {
const u = new URLSearchParams(location.search);
if (u.has('vectormap')) {
localStorage.setItem('by_vector_map', u.get('vectormap') === '0' ? '0' : '1');
}
return localStorage.getItem('by_vector_map') === '1';
const flag = localStorage.getItem('by_vector_map');
if (flag === '1') return true;
if (flag === '0') return false;
return /(^|\.)staging\.banyaro\.app$/.test(location.hostname);
} catch (e) { return false; }
}