From a8ac7415f8b5e9e9dc36318a04b7da7775796a88 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 12 May 2018 09:47:21 +0900 Subject: Fix tab completions --- src/background/shared/completions/tabs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/background/shared/completions/tabs.js') diff --git a/src/background/shared/completions/tabs.js b/src/background/shared/completions/tabs.js index 5edddca..8c0f1f9 100644 --- a/src/background/shared/completions/tabs.js +++ b/src/background/shared/completions/tabs.js @@ -1,7 +1,9 @@ -const getCompletions = (keyword) => { +const getCompletions = (keyword, excludePinned) => { return browser.tabs.query({ currentWindow: true }).then((tabs) => { let matched = tabs.filter((t) => { return t.url.includes(keyword) || t.title && t.title.includes(keyword); + }).filter((t) => { + return !(excludePinned && t.pinned); }); return matched; }); -- cgit v1.2.3