       selectors = [ "a[target=_blank]", "a[href~=http", "a[href~=https]", "a" ]
       selectors = [ (Common.stringToArray @config.activators)..., selectors... ] if @config.activators
       for selector in selectors
-        try
-          if candidate = element.querySelector selector
+          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()

class Interface
  debug:
    config: false

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


    if action == "enter"
      element = @element ? document.activateElement
      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
