BLOG-92 Fix improve google font loading efficiency #111
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLOG-92_improve_font_loading_efficiency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Reference: https://web.dev/learn/performance/understanding-the-critical-path?utm_source=lighthouse&utm_medium=lr&hl=zh-tw#render-blocking_resources/
Package Changes
No response
Screenshots
No response
Reference
Resolves #92
Checklist
/improve
PR Code Suggestions ✨
Avoid inline script for CSP compatibility
The inline
onload
scriptthis.media='all'
can be blocked by a strict ContentSecurity Policy (CSP) that disallows
unsafe-inline
scripts. This would prevent theGoogle Fonts from loading for users with JavaScript enabled. Consider moving this
logic to an external JavaScript file or using a
nonce
attribute if your CSP allowsit.
frontend/src/app.html [20-25]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a potential Content Security Policy (CSP) issue with the inline
onload
script. Moving this logic to an external JavaScript file or using anonce
attribute is a good security practice to preventunsafe-inline
script execution.BLOG-92 fix: improve google font loading efficiencyto BLOG-92 Fix improve google font loading efficiencyAddressed in
1e1bae0812
.