algospaced-dsa / algospaced-ui /dist /loader-init.js
iamfebin's picture
feat(security): implement strict CSP security headers middleware and externalize inline scripts
e3d939d
Raw History Blame Contribute Delete
642 Bytes
/**
* Early workspace wallpaper initialization for skeleton screen.
* Encapsulated in an external static script to eliminate inline scripts
* and uphold a strict Content Security Policy (no 'unsafe-inline' in script-src).
*/
(function () {
try {
var bgUrl = localStorage.getItem('desktopWallpaperUrl');
if (!bgUrl || bgUrl.indexOf('lh3.googleusercontent.com') !== -1) {
bgUrl = '/wallpapers/default.webp';
}
var bgEl = document.getElementById('skel-bg');
if (bgEl) {
bgEl.style.backgroundImage = "url('" + bgUrl + "')";
}
} catch {
// Graceful fallback if localStorage is unavailable
}
})();