Skip to content

Commit

Permalink
anti adblock
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyang0507 committed Nov 24, 2024
1 parent 956102c commit 2c72df4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/CheckAdBlocked.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@
}
onMount(() => {
const interval = setInterval(checkAdBlocker, 5000);
return () => clearInterval(interval);
// 延迟 5 秒后开始第一次检测,给页面足够的加载时间
setTimeout(() => {
checkAdBlocker();
// 之后每 30 秒检测一次
const interval = setInterval(checkAdBlocker, 30000);
return () => clearInterval(interval);
}, 5000);
});
</script>
Expand Down

0 comments on commit 2c72df4

Please sign in to comment.