diff options
| -rw-r--r-- | background_scripts/completion.coffee | 2 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 12 | ||||
| -rw-r--r-- | content_scripts/mode_find.coffee | 2 | ||||
| -rw-r--r-- | content_scripts/vimium.css | 2 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 6 | ||||
| -rw-r--r-- | lib/dom_utils.coffee | 4 | ||||
| -rw-r--r-- | pages/vomnibar.coffee | 2 | 
7 files changed, 18 insertions, 12 deletions
| diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 7cd47a00..66ad2e38 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -779,7 +779,7 @@ HistoryCache =    # correct "lastVisitTime". That's crucial for ranking Vomnibar suggestions.    onPageVisited: (newPage) ->      i = HistoryCache.binarySearch(newPage, @history, @compareHistoryByUrl) -    pageWasFound = (@history[i].url == newPage.url) +    pageWasFound = (@history[i]?.url == newPage.url)      if pageWasFound        @history[i] = newPage      else diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 9f04d1c0..76fbcd96 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -301,10 +301,14 @@ Frames =      (portsForTab[tabId] ?= {})[frameId] = port    unregisterFrame: ({tabId, frameId}) -> -    if tabId of frameIdsForTab -      frameIdsForTab[tabId] = (fId for fId in frameIdsForTab[tabId] when fId != frameId) -    if tabId of portsForTab -      delete portsForTab[tabId][frameId] +    # FrameId 0 is the top/main frame.  We never unregister that frame.  If the tab is closing, then we tidy +    # up elsewhere.  If the tab is navigating to a new page, then a new top frame will be along soon. +    # This mitigates against the unregister and register messages arriving in the "wrong" order. +    if 0 < frameId +      if tabId of frameIdsForTab +        frameIdsForTab[tabId] = (fId for fId in frameIdsForTab[tabId] when fId != frameId) +      if tabId of portsForTab +        delete portsForTab[tabId][frameId]      HintCoordinator.unregisterFrame tabId, frameId    isEnabledForUrl: ({request, tabId, port}) -> diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee index ad7cc136..4c146889 100644 --- a/content_scripts/mode_find.coffee +++ b/content_scripts/mode_find.coffee @@ -179,7 +179,7 @@ class FindMode extends Mode      if options.colorSelection        setTimeout( -        -> document.addEventListener("selectionchange", @restoreDefaultSelectionHighlight, true) +        => document.addEventListener("selectionchange", @restoreDefaultSelectionHighlight, true)        , 0)      # We are either in normal mode ("n"), or find mode ("/").  We are not in insert mode.  Nevertheless, if a diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css index 8803fd15..be9d4a65 100644 --- a/content_scripts/vimium.css +++ b/content_scripts/vimium.css @@ -382,7 +382,7 @@ iframe.vomnibarFrame {    z-index: 2147483646;  } -div#vimiumFlash { +div.vimiumFlash {    box-shadow: 0px 0px 4px 2px #4183C4;    padding: 1px;    background-color: transparent; diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 7ff03ee5..07322250 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -563,7 +563,8 @@ findAndFollowLink = (linkStrings) ->      linkMatches = false      for linkString in linkStrings -      if (link.innerText.toLowerCase().indexOf(linkString) != -1) +      if link.innerText.toLowerCase().indexOf(linkString) != -1 || +          link.value?.indexOf(linkString) != -1          linkMatches = true          break      continue unless linkMatches @@ -595,7 +596,8 @@ findAndFollowLink = (linkStrings) ->        else          new RegExp linkString, "i"      for candidateLink in candidateLinks -      if (exactWordRegex.test(candidateLink.innerText)) +      if exactWordRegex.test(candidateLink.innerText) || +          (candidateLink.value && exactWordRegex.test(candidateLink.value))          followLink(candidateLink)          return true    false diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 07598a85..8e953405 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -274,8 +274,8 @@ DomUtils =    addFlashRect: (rect) ->      flashEl = @createElement "div" -    flashEl.id = "vimiumFlash" -    flashEl.className = "vimiumReset" +    flashEl.classList.add "vimiumReset" +    flashEl.classList.add "vimiumFlash"      flashEl.style.left = rect.left + "px"      flashEl.style.top = rect.top + "px"      flashEl.style.width = rect.width + "px" diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 449c0bac..95ef8151 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -136,7 +136,7 @@ class VomnibarUI          @input.value.trim().length == 0            @seenTabToOpenCompletionList = true            @update true -      else +      else if 0 < @completions.length          @selection += 1          @selection = @initialSelectionValue if @selection == @completions.length          @updateSelection() | 
