feat(security,ui): self-host React deps, Tailwind, fonts; strict CSP; local QR; better selection state
Replace CDN React/ReactDOM/Babel with local libs; remove Babel and inline scripts Build Tailwind locally, add safelist; switch to assets/tailwind.css Self-host Font Awesome and Inter (CSS + woff2); remove external font CDNs Implement strict CSP (no unsafe-inline/eval; scripts/styles/fonts from self) Extract inline handlers; move PWA scripts to external files Add local QR code generation (qrcode lib) and remove api.qrserver.com Improve SessionTypeSelector visual selection (highlighted background and ring) Keep PWA working with service worker and offline assets Refs: CSP hardening, offline-first, no external dependencies
This commit is contained in:
@@ -1063,7 +1063,7 @@ class PWAOfflineManager {
|
||||
// Singleton pattern
|
||||
let instance = null;
|
||||
|
||||
const PWAOfflineManager = {
|
||||
const PWAOfflineManagerAPI = {
|
||||
getInstance() {
|
||||
if (!instance) {
|
||||
instance = new PWAOfflineManager();
|
||||
@@ -1078,9 +1078,9 @@ const PWAOfflineManager = {
|
||||
|
||||
// Export for module use
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = PWAOfflineManager;
|
||||
module.exports = PWAOfflineManagerAPI;
|
||||
} else if (typeof window !== 'undefined' && !window.PWAOfflineManager) {
|
||||
window.PWAOfflineManager = PWAOfflineManager;
|
||||
window.PWAOfflineManager = PWAOfflineManagerAPI;
|
||||
}
|
||||
|
||||
// Auto-initialize when DOM is ready
|
||||
@@ -1088,12 +1088,12 @@ if (typeof window !== 'undefined' && !window.pwaOfflineManager) {
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (!window.pwaOfflineManager) {
|
||||
window.pwaOfflineManager = PWAOfflineManager.init();
|
||||
window.pwaOfflineManager = PWAOfflineManagerAPI.init();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!window.pwaOfflineManager) {
|
||||
window.pwaOfflineManager = PWAOfflineManager.init();
|
||||
window.pwaOfflineManager = PWAOfflineManagerAPI.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user