summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2025-12-09 11:01:59 +0800
committerBigCoke233 <hi@guhub.cn>2025-12-09 11:01:59 +0800
commit952474bd4c55ae8db31add49f6e003cd5ed61262 (patch)
tree29d24252f2846d2a07a38fc99caa8b21d0747e59
parentab5dacc2854e5597b882ec48f0e108e063460793 (diff)
fix #141
-rw-r--r--layouts/_partials/posts/comment.html7
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>