From 722cd3c40f89d93682f08e88b6d4cb46ca70991e Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 14 Sep 2016 08:02:22 +0100 Subject: Require exact match when we will be scrolling. If the user is jumping to a scroll position within a tab, then we need an exact match on the URL (because otherwise the scroll position doesn't really have a meaning). Otherwise we only require a prefix match, a la #2250. --- background_scripts/marks.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'background_scripts') 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. -- cgit v1.2.3