You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过浏览器控制台加速第三方网站的setTimeout倒计时器?

Shorten 1-Hour Timer to 20/30 Minutes via Browser Console

Alright, let's tackle this problem directly. Since you can't edit the site's source code, we'll override the existing timer logic using your browser's JavaScript console. Here's exactly how to do it:

Step 1: Understand the Original Timer Logic

The site uses two key components for the timer:

  • A countdown plugin that displays the minutes/seconds timer (set to 3600 seconds = 1 hour)
  • A setTimeout that triggers RefreshPageAfterFreePlayTimerEnds() after 1 hour to reset the button

We need to replace both with our desired 20 or 30-minute duration.

Step 2: Run This Code in Your Browser Console

First, open your browser's developer tools (press F12 or Ctrl+Shift+I), switch to the Console tab, then paste the code below. Adjust the duration by changing the newWaitSeconds value:

// Save the original refresh function so we can still use it later
const originalRefresh = window.RefreshPageAfterFreePlayTimerEnds;

// Clear ALL existing timeouts (the original 1-hour timeout has no variable reference, so this is the safest way)
let timerId = setTimeout(() => {}, 0);
while (timerId--) {
    clearTimeout(timerId);
}

// Destroy the original countdown timer instance
$('#time_remaining').countdown('destroy');

// Set your desired wait time in seconds: 20 mins = 1200, 30 mins = 1800
const newWaitSeconds = 1200; 

// Initialize a new countdown with your custom duration
$('#time_remaining').countdown({
    until: +newWaitSeconds,
    format: 'MS', // Keep the minutes/seconds display format
    onExpiry: function() {
        // Trigger the original refresh function when our timer ends
        originalRefresh();
    }
});

How It Works

  • Clearing Timeouts: The original 1-hour timeout isn't stored in a variable, so we loop through all possible timer IDs to clear it—this ensures it won't fire later and interfere with our custom timer.
  • Replacing the Countdown: We destroy the old countdown instance and create a new one with your chosen duration (1200 seconds for 20 mins, 1800 for 30 mins).
  • Preserving Functionality: We save and reuse the original RefreshPageAfterFreePlayTimerEnds() function so the page behaves exactly as it should when the timer finishes.

Notes

  • This only applies to your current browser session—if you refresh the page, you'll need to run the code again after clicking "Roll".
  • Make sure to run this code right after the original timer starts (after clicking "Roll").

内容的提问来源于stack exchange,提问作者Ram Lal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:24:20