سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 23:15 UTC
fix(startup): enable deferred font after load using CSP-compatible local listener
davoodmehraban89 committed
Oct 12, 2026 at 12:44 UTC
2ca09b222b010929f34ae8edad0381ccdeca322c
1 file changed
+9
js/bootstrap.js
+9
@@ -28,6 +28,15 @@ function finoraLoadScript(src){
28
document.head.appendChild(script);
29
});
30
}
31
+// Optional remote font must never block authentication or application scripts.
32
+// This handler is installed from a local JS file because Pages strips inline
33
+// HTML event handlers under its strict CSP. Tahoma remains a usable fallback.
34
+const finoraFontLink=document.getElementById('finora-optional-font');
35
+if(finoraFontLink){
36
+ const applyFont=()=>{finoraFontLink.media='all'};
37
+ finoraFontLink.addEventListener('load',applyFont,{once:true});
38
+ if(finoraFontLink.sheet)applyFont();
39
+}
40
window.addEventListener('DOMContentLoaded',async()=>{
41
const started=performance.now();
42
const results=await Promise.allSettled(FINORA_EXTENSION_SCRIPTS.map(finoraLoadScript));