Use queryByKeyword for tab operations
This commit is contained in:
parent
e286aab3d7
commit
68fa80e1a3
2 changed files with 27 additions and 33 deletions
|
@ -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 };
|
||||
|
|
Reference in a new issue