egapool
10/19/2016 - 5:47 AM

クライアントエリアー(ブラウザ)を収集する

クライアントエリアー(ブラウザ)を収集する

/* collect client errors */
var reportingUrl = "http://some-recieve-url.com/";
window.onerror = function(message, file, lineNumber,col, error) {
  new Image().src = reportingUrl+"?message="
    + encodeURIComponent(message)
    + "&url=" + encodeURIComponent(location.href)
    + "&file=" + encodeURIComponent(file)
    + "&lineNumber=" + encodeURIComponent(lineNumber)
    + "&userAgent=" + encodeURIComponent(navigator.userAgent);
};