Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automagically look up JavaScript errors on Stack Overflow ;-)

Automagically look up JavaScript errors on Stack Overflow 😄

window.onerror = function(message) {
top.location.href = 'http://stackoverflow.com/search?q=' +
encodeURIComponent(message + ' [js]');
};
@daniellmb

This comment has been minimized.

Copy link
Owner Author

daniellmb commented Feb 10, 2016

Want to try it? Just past the function into the Dev Tools and execute it, then throw an error using setTimeout like so:

setTimeout(function() { foo; }, 0)

You'll end up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.