Created
April 29, 2016 12:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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