This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/background/shared/completions/tabs.js
2018-05-12 10:54:38 +09:00

12 lines
371 B
JavaScript

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;
});
};
export { getCompletions };