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 | a8f2d71a2975b1cde36571886825d49da5239d1c (patch) | |
| tree | 29d24252f2846d2a07a38fc99caa8b21d0747e59 /layouts/_partials/posts/comment.html | |
| parent | 59b1c16f7c38f9b95abf58760477b1e7a57b9f52 (diff) | |
fix #141
Former-commit-id: 952474bd4c55ae8db31add49f6e003cd5ed61262
Diffstat (limited to 'layouts/_partials/posts/comment.html')
| -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> |
