Errorception tracking snippet - extra verbosity edition

  • Download Gist
errorception-tracking-script-minified.html
HTML
1 2 3 4
<script>var _errs=["<application id here>"];(function(a,b){if(b.location.protocol!="https:"){a.onerror=function(a,c,b)
{_errs.push({m:a,u:c,l:b});return!1};var d=function(){var a=b.createElement("script"),
c=b.getElementsByTagName("script")[0];a.src="http://errorception.com/projects/"+_errs[0]+"/beacon.js";c.parentNode.insertBefore(a,c)};
a.addEventListener?a.addEventListener("load",d,!1):a.attachEvent("onload",d)}})(window,document);</script>
errorception-tracking-script-verbose.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<!--
Note: DO NOT use this script - it is too verbose.
You will have a minified version of this script available to you in your admin settings.
-->
<script>
var _errs = ["<application id here>"]; // This is the error "queue" - the only variable we add in the global namespace
(function (window, document) {
// This self-executing function lets us control scope better,
// and gives us better compressibility using common minifiers.
 
if (document.location.protocol != "https:") { // For now, we aren't supporting https
window.onerror = function (msg, url, line) {
_errs.push({m: msg, u: url, l: line}); // Push new errors into the queue as they occur
return false;
};
 
var loader = function () {
var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
script.src = "http://errorception.com/projects/" + _errs[0] + "/beacon.js";
tag.parentNode.insertBefore(script, tag);
};
 
// Wait until window.onload before downloading any more code.
window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
}
})(window, document);
</script>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.