(function(){

  window.onerror = function(msg, file, line) {
    var xhr = new XMLHttpRequest();
    xhr.open("POST", '/log', true);
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.send(JSON.stringify({
      msg: navigator.userAgent + '\n' + location.href + '\n' + file + ':' + line + '\n' + msg
    }));
  }

})(window);

@@ -321,16 +321,58 @@
    %7D));%0A
+    alert('%E6%8A%B1%E6%AD%89%EF%BC%8C%E6%82%A8%E7%9A%84%E6%B8%B8%E8%A7%88%E5%99%A8%E5%87%BA%E7%8E%B0%E5%BC%82%E5%B8%B8%EF%BC%8C%E5%A6%82%E9%9C%80%E7%BB%A7%E7%BB%AD%EF%BC%8C%E8%AF%B7%E5%B0%9D%E8%AF%95%E5%85%B6%E4%BB%96%E6%B8%B8%E8%A7%88%E5%99%A8%E3%80%82');%0A
   %7D%0A%0A%7D)(

Add alert when error occurs.