Refactor background directories
This commit is contained in:
parent
c5c08783d2
commit
98bc2326ee
9 changed files with 19 additions and 21 deletions
10
src/background/shared/completions/tabs.js
Normal file
10
src/background/shared/completions/tabs.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const getCompletions = (keyword) => {
|
||||
return browser.tabs.query({ currentWindow: true }).then((tabs) => {
|
||||
let matched = tabs.filter((t) => {
|
||||
return t.url.includes(keyword) || t.title && t.title.includes(keyword);
|
||||
});
|
||||
return matched;
|
||||
});
|
||||
};
|
||||
|
||||
export { getCompletions };
|
Reference in a new issue