diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-05-31 21:27:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 21:27:30 +0900 |
commit | f467e9bf20fd75723d83425b9c93b295161639f1 (patch) | |
tree | ab0de48e909cf229437a2ff85720c69bd616ed89 /src/background/shared/completions | |
parent | 982a54c0aa6d1ae99932a05100bceafad6d3669c (diff) | |
parent | 0f3ad23085c8e2fd7c350590b3ee87cac6ade945 (diff) |
Merge pull request #405 from ueokande/ignore-case-tab-filtering
Ignore case tab filtering
Diffstat (limited to 'src/background/shared/completions')
-rw-r--r-- | src/background/shared/completions/tabs.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/background/shared/completions/tabs.js b/src/background/shared/completions/tabs.js index 8c0f1f9..bdb2741 100644 --- a/src/background/shared/completions/tabs.js +++ b/src/background/shared/completions/tabs.js @@ -1,12 +1,8 @@ +import * as tabs from '../tabs'; + 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; - }); + return tabs.queryByKeyword(keyword, excludePinned); }; + export { getCompletions }; |