   xhr = new XMLHttpRequest
   xhr.open 'GET', url, true
   xhr.setRequestHeader 'Accept', 'text/html, application/xhtml+xml, application/xml'
-  xhr.onload = -> fullReplacement xhr.responseText, url
+  xhr.onload  = -> fullReplacement xhr.responseText, url
+  xhr.onabort = -> console.log("Aborted turbolink fetch!")
   xhr.send()
 
 fullReplacement = (html, url) ->


browserSupportsPushState = window.history and window.history.pushState and window.history.replaceState


if browserSupportsPushState
  window.addEventListener 'popstate', (event) ->
    if event.state?.turbolinks
      fetchReplacement document.location.href

visit = (url) ->
  if browserSupportsPushState?
    reflectNewUrl url
    fetchReplacement url
  else
