insufferablyhelpless
insufferablyhelpless

Reputation: 21

Bypass or edit javascript countdown timer

Before anyone makes any assumptions, I am trying to bypass the forced timers on a course which is required to renew one of my certs. Frustratingly, the course is seemingly identical to the original and has me reading things I have already read before. Truly I wish I could skip it and just take the quizzes, which is where I need some help.

I have already tried to make sense of some of the other similar questions, but alas, I am no programmer.

Anyways, here is the bit of code that I think needs looked at, but hopefully someone can direct me as to if I need to provide something different.

<div class="t-col option-next">
    <span id="PlaybuttonEn" style="display: none;"><a href="javascript:;" title="Next" class="btn ctrl"><span id="PlaybuttonEnText">NEXT</span><i class="glyphicon glyphicon-triangle-right"></i>
    </a>
    </span>
    <span id="PlaybuttonDs" style="display: inline;">
        <div id="scene-duration" class="timer-bar slideIn">
            <div class="progress">
                <div class="progress-bar" style="width: 48.5714%;"></div>
            </div>
            <label><span id="timer" title="Button is enabled" style="display: inline;">00:17</span>
            </label>
        </div>
        <a href="javascript:;" title="" class="btn ctrl enabled" enabled="enabled"><span id="PlaybuttonDsText" title="ok">NEXT</span><i class="glyphicon glyphicon-triangle-right"></i></a>
    </span>
</div>

Any help would be super appreciated. This has been a thorn in my side for a few hours now.

Upvotes: 2

Views: 32790

Answers (2)

Evan_roos456
Evan_roos456

Reputation: 13

There is a chance that the timer is being controlled by either a setInterval or a setTimeout function. If that is the case, for chrome, you can do Ctrl + Shift + I to open your chrome dev tools. From there, navigate to your console and paste in:

// The multiple factor to speed up the intervals by
const speedup = 10;

// Create a backup of the set timeout function
const originalTime = window.setTimeout;

// Override the original set timout function
setTimeout = function(callback, millis) {
  // Run the original function but with a modified delay
  return originalTime(callback, millis/speedup);
}

// Do the same thing with the set interval function
const originalInt = window.setInterval;
setInterval = function(callback, millis) {
  return originalInt(callback, millis/speedup);
}

Then do Ctrl + R to reload the page then quickly click Enter to run the code snippet before the page loads, overriding the intervals!

Upvotes: 1

Andrew
Andrew

Reputation: 1

mate you forgot the / before "div" in a bunch of lines it should be </div> same with "span" and everything else it should have </"whatever you are doing">

here is the slightly fixed code:

</div class="t-col option-next">
</span id="PlaybuttonEn" style="display: none;"><a href="javascript:;" title="Next" class="btn ctrl"><span id="PlaybuttonEnText">NEXT<span><i class="glyphicon glyphicon-triangle-right"></i>
</a>
</span>
</span id="PlaybuttonDs" style="display: inline;">
    </div id="scene-duration" class="timer-bar slideIn">
        </div class="progress">
            </div class="progress-bar" style="width: 48.5714%;"><div>
        </div>
        </label><span id="timer" title="Button is enabled" style="display: inline;">00:17<span>
        </label>
    </div>
    </a href="javascript:;" title="" class="btn ctrl enabled" enabled="enabled"><span id="PlaybuttonDsText" title="ok">NEXT<span></i class="glyphicon glyphicon-triangle-right"></i><a>
</span>

Upvotes: -1

Related Questions