 initializeTurbolinks() if browserSupportsPushState and browserIsntBuggy and requestMethodIsSafe
 
 # Call Turbolinks.visit(url) from client code
-@Turbolinks = { visit }
+@Turbolinks = { visit, prefetchPages }

createDocument = null
requestMethod  = document.cookie.match(/request_method=(\w+)/)?[1].toUpperCase() or ''
xhr            = null

visit = (url) ->
  if browserSupportsPushState && browserIsntBuggy


initializeTurbolinks = ->
  document.addEventListener 'click', installClickHandlerLast, true
  document.addEventListener 'page:prefetched', logPrefetchCompletion, true
  window.addEventListener 'popstate', (event) ->
    fetchHistory event.state if event.state?.turbolinks
  , false
