   advance: (offset = 1) =>
     this.advanceTo(Math.max(Math.min(@currentSlide + offset, @length - 1), 0))
 
-  isFile: => location.href.slice(0, 4) == 'file'
-
   advanceTo: (index) =>
     @priorSlide = @currentSlide
     @currentSlide = index || 0
 
     this.calculate()
 
-    if this.isFile()
-      location.hash = @currentSlide
-    else
-      history.pushState({ index: @currentSlide }, '', @currentSlide)
+    location.hash = @currentSlide
 
   calculate: =>
     if @currentWindowHeight != window.innerHeight

    @_slidesViewer ||= document.querySelector(@identifier)

  start: ->
    if !this.isFile()
      window.addEventListener('popstate', @handlePopState, false)

    @timer.render()

    document.addEventListener('click', @handleClick, false)

    imageWait()

  slideFromLocation: ->
    Number(location.hash.substr(1))

  handlePopState: (e) =>
    this.advanceTo(this.slideFromLocation())

  handleClick: (e) =>
    this.advance() if e.target.tagName != 'A'
