aboutsummaryrefslogtreecommitdiff
path: root/src/background/shared/completions
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/shared/completions')
-rw-r--r--src/background/shared/completions/tabs.js12
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 };