adequately good

decent programming advice

written by ben cherry



all articles from the year 2011

Replacing `setTimeout` Globally

Sometimes, you might want to overwrite built-in global methods like setTimeout and setInterval. If you try, you might find that it's much harder than you think to accomplish this in every browser, particularly if you ever want to find the originals again. After a lot of painful experimentation, I think I have a definitive solution that works in all browsers with minimal side-effects.

Failed Approaches

I started ...