         return
 
       relative = absoluteHref.slice(root.length)
+
+      # TODO
+      # this is triggered twice per click. why ?
+      console.log 'relative anchor click', relative
 
       cb
         event: event

    # (every time a relative anchor is clicked the path cursor is updated)
    onRelativeAnchorClick window, (data) ->
      data.event.preventDefault()
      console.log 'relative anchor click', data.relative
      setBrowserPath data.relative
      pathCursor.set(data.relative)

      throw new Error 'missing argument'

    el.addEventListener 'click', (event) ->
      target = event.target

      # console.log 'click',
      #   tagName: target.tagName
      #   bypass: target.dataset.bypass?
      #   href: target.getAttribute('href')
      #   absoluteHref: target.href
      #   root: getBrowserUrlProtocolHost()
      #   bubbles: event.bubbles
      #   isRelative: event.target.href.slice(0, getBrowserUrlProtocolHost().length) is root

      # find the containing A tag
      while target? and target.tagName isnt 'A'
        target = target.parentNode
        unless target?
          return

      # now we have an A tag

      # does the element have attribute `data-bypass` ?
      if target.dataset.bypass?
        return

      # don't break the users ability to open links in a new tab !
      if event.ctrlKey or event.metaKey
        return

      href = target.getAttribute('href')
      absoluteHref = target.href

      root = getBrowserUrlProtocolHost()

