I am trying to add my own error handling to the JavaScript setTimeout function. The following code works fine in chrome:
var oldSetTimeout = window.setTimeout;
Minor improvement to the Answer of Tim Down to mimic the original even more:
window.oldSetTimeout = window.setTimeout; window.setTimeout = function(func, delay) { return window.oldSetTimeout(function() { try { func(); } catch (exception) { //Do Error Handling } }, delay); };