function pingRefresh() {
  var location = window.location;
  var xhr = new XMLHttpRequest();
  xhr.open('HEAD', location);
  xhr.onreadystatechange = function() {
    if (this.readyState == 4 && (this.status == 0 || (this.status >= 200 && this.status < 300))) {
        window.location.reload();       
    }
  }
  xhr.send(null);
}
 
setTimeout(pingRefresh, 120000);

