diff options
| -rw-r--r-- | background_scripts/marks.coffee | 3 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee index 29029b4d..daf28748 100644 --- a/background_scripts/marks.coffee +++ b/background_scripts/marks.coffee @@ -63,6 +63,9 @@ Marks = # The tab we're trying to find no longer exists. We either find another tab with a matching URL and use it, # or we create a new tab. focusOrLaunch: (markInfo, req) -> + # If we're not going to be scrolling to a particular position in the tab, then we choose all tabs with a + # matching URL prefix. Otherwise, we require an exact match. + query = if markInfo.scrollX == markInfo.scrollY == 0 then "#{markInfo.url}*" else markInfo.url chrome.tabs.query { url: "#{markInfo.url}*" }, (tabs) => if 0 < tabs.length # We have at least one matching tab. Pick one and go to it. diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index f11c8f4b..aea1b6ac 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -257,8 +257,8 @@ Frame = window.removeEventListener "hashchange", onFocus setScrollPosition = ({ scrollX, scrollY }) -> - if DomUtils.isTopFrame() - DomUtils.documentReady -> + DomUtils.documentReady -> + if DomUtils.isTopFrame() window.focus() document.body.focus() if 0 < scrollX or 0 < scrollY |
