diff options
| -rw-r--r-- | content_scripts/injected.coffee | 8 | ||||
| -rw-r--r-- | content_scripts/link_hints.coffee | 6 | ||||
| -rw-r--r-- | manifest.json | 2 | 
3 files changed, 7 insertions, 9 deletions
| diff --git a/content_scripts/injected.coffee b/content_scripts/injected.coffee index 1c743134..4148ffa5 100644 --- a/content_scripts/injected.coffee +++ b/content_scripts/injected.coffee @@ -3,19 +3,17 @@  # This is based on method 2b here: http://stackoverflow.com/a/9517879, and  # @mrmr1993's #1167. -window.vimiumOnClickAttributeName = "_vimium-has-onclick-listener" - -injectedCode = (vimiumOnClickAttributeName) -> +injectedCode = () ->    # Note the presence of "click" listeners installed with `addEventListener()` (for link hints).    _addEventListener = Element::addEventListener    Element::addEventListener = (type, listener, useCapture) ->      if type == "click" -      try @setAttribute vimiumOnClickAttributeName, "" +      try @setAttribute "_vimium-has-onclick-listener", ""      _addEventListener?.apply this, arguments  script = document.createElement "script" -script.textContent = "(#{injectedCode.toString()})('#{vimiumOnClickAttributeName}')" +script.textContent = "(#{injectedCode.toString()})()"  (document.head || document.documentElement).appendChild script  script.remove() diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 7cd2dfbf..44f7a5f5 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -571,9 +571,9 @@ class FilterHints                if position < 0                  0 # No match.                else if position == 0 and searchWord.length == linkWord.length -                if idx == 0 then 8 else 6 # Whole-word match. +                if idx == 0 then 8 else 4 # Whole-word match.                else if position == 0 -                if idx == 0 then 4 else 2 # Match at the start of a word. +                if idx == 0 then 6 else 2 # Match at the start of a word.                else                  1 # 0 < position; other match.            Math.max linkWordScores... @@ -707,7 +707,7 @@ LocalHints =          reason = "Open."      # Detect elements with "click" listeners installed with `addEventListener()`. -    isClickable ||= element.hasAttribute vimiumOnClickAttributeName +    isClickable ||= element.hasAttribute "_vimium-has-onclick-listener"      # An element with a class name containing the text "button" might be clickable.  However, real clickables      # are often wrapped in elements with such class names.  So, when we find clickables based only on their diff --git a/manifest.json b/manifest.json index 507d5217..bc8c64cf 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@  {    "manifest_version": 2,    "name": "Vimium", -  "version": "1.62.6", +  "version": "1.62.8",    "description": "The Hacker's Browser. Vimium provides keyboard shortcuts for navigation and control in the spirit of Vim.",    "icons": {  "16": "icons/icon16.png",                "48": "icons/icon48.png", | 
