 
   targetHostSame: (aTag) =>
     l = window.location
-    # Firefox 26 sets window.location.username to undefined by default
-    locationUserName = l.username
-    if !locationUserName
-      locationUserName = ""
-    aTag.host == l.host && aTag.protocol == l.protocol && aTag.username == locationUserName && aTag.password == aTag.password
+    # Firefox 26 sets aTag.username to "", other browsers use undefined
+    targetUserName = aTag.username
+    if targetUserName == ""
+      targetUserName = undefined
+    aTag.host == l.host && aTag.protocol == l.protocol && targetUserName == l.username && aTag.password == aTag.password
 
   attachLocationChangeListener: =>
     if @pushStateSupport

  postExecutionListeners: []
  debug: false
  log: =>
    if @debug
      console.log.apply(this, arguments)
  add: (urlPattern, fn, metadata) =>
    @routes.push({route: new SinatraRouteParser(urlPattern), fn: fn, urlPattern: urlPattern, metadata: metadata})
  exec: (path) =>

      if target.tagName == "A"
        return target
      target = target.parentElement
    false

  metakeyPressed: (event) =>
    (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey)
