diff options
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> |
