diff options
| author | BigCoke233 <hi@guhub.cn> | 2025-12-09 11:01:59 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2025-12-09 11:01:59 +0800 |
| commit | 952474bd4c55ae8db31add49f6e003cd5ed61262 (patch) | |
| tree | 29d24252f2846d2a07a38fc99caa8b21d0747e59 /layouts | |
| parent | ab5dacc2854e5597b882ec48f0e108e063460793 (diff) | |
fix #141
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_partials/posts/comment.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/_partials/posts/comment.html b/layouts/_partials/posts/comment.html index 78621c22..6e959f49 100644 --- a/layouts/_partials/posts/comment.html +++ b/layouts/_partials/posts/comment.html @@ -56,5 +56,10 @@ function loadGiscus() { document.body.appendChild(script); } -window.addEventListener("load", () => { requestIdleCallback(() => loadGiscus()); }); +if ("requestIdleCallback" in window) { + requestIdleCallback(() => loadGiscus()); +} else { + // fallback for Safari + window.addEventListener("load", () => { loadGiscus(); }); +} </script> |
