-
Notifications
You must be signed in to change notification settings - Fork 11
Lighthouse & GA4 updates for srccon.org #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
01203ad
6f3b7f7
51ebda9
69a8a3b
254e269
2c7b88f
0dc50f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,18 @@ | |||||||||||
| <script src="https://use.typekit.net/mvg8obr.js"></script> | ||||||||||||
| <script> | ||||||||||||
| try { | ||||||||||||
| Typekit.load({ async: true }); | ||||||||||||
| Typekit.load({ | ||||||||||||
| async: true, | ||||||||||||
| scriptTimeout: 1200, | ||||||||||||
| classes: true, | ||||||||||||
| events: true, | ||||||||||||
| active: function () { | ||||||||||||
| document.documentElement.classList.remove("fonts-fallback-locked"); | ||||||||||||
| }, | ||||||||||||
| inactive: function () { | ||||||||||||
| document.documentElement.classList.add("fonts-fallback-locked"); | ||||||||||||
| }, | ||||||||||||
| }); | ||||||||||||
| } catch (e) {} | ||||||||||||
|
||||||||||||
| } catch (e) {} | |
| } catch (e) { | |
| // If Typekit fails to load or throws before calling inactive, ensure fallback fonts are locked. | |
| document.documentElement.classList.add("fonts-fallback-locked"); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async: trueinTypekit.load(...)does not make the kit download non-blocking; the kit is still loaded via a plain<script src=...>tag (noasync/deferred loading). If the goal is Lighthouse/perf improvement, consider loading the Typekit kit script asynchronously (e.g., addasyncto the script tag or use the recommended non-blocking embed pattern) so it doesn’t block HTML parsing.