Skip to content

Instantly share code, notes, and snippets.

@derhasi
Created April 29, 2016 12:55
Show Gist options
  • Save derhasi/34c707e4269a33e7b0dfc0f23cd3b341 to your computer and use it in GitHub Desktop.
Save derhasi/34c707e4269a33e7b0dfc0f23cd3b341 to your computer and use it in GitHub Desktop.
Small helper script (e.g. for Chrome Snippets) to throw a Browser Notification when a .error occurs
Notification.requestPermission().then(function(result) {
function checkError() {
console.log('check error');
if (jQuery('.error').length > 0) {
new Notification("Batch error occured");
}
else {
setTimeout(checkError, 10000);
}
}
checkError();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment