 
     if action == "enter"
       element = @element ? document.activateElement
-      try
-        element = document.querySelector @config.activeSelector if not element and @config.activeSelector
-        return unless element
-        return unless Common.isInViewport element
-
-        @activateElement element, event
+      if not element and @config.activeSelector
+        element = @querySelector document, @config.activeSelector
+      return unless element
+      return unless Common.isInViewport element
+
+      @activateElement element, event
 
     else if action in [ "up", "down" ]
       return if @config.nativeJK

class Interface
  debug:
    config: false

  constructor: (@config) ->
    @element = null

      selectors = [ "a[target=_blank]", "a[href~=http", "a[href~=https]", "a" ]
      selectors = [ (Common.stringToArray @config.activators)..., selectors... ] if @config.activators
      for selector in selectors
          if candidate = @querySelector element, selector
            activate candidate
            return

  querySelector: (element, selector, all = false) ->
    search = (selector) ->
      if all then element.querySelectorAll selector else element.querySelector selector
    try
      console.log "#{selector} #{all}:" if @debug.selector
      console.log "  #{search selector}" if @debug.selector
      search selector
    catch
      console.error "bad CSS selector: #{selector}"
      if all then [] else null
Config =
  lookup: (configs, callback) ->
    url = document.location.toString()
