Buffer completion on Clean Architecture
This commit is contained in:
parent
bf7c125fb2
commit
890d93fe77
3 changed files with 47 additions and 15 deletions
11
src/background/repositories/completions.js
Normal file
11
src/background/repositories/completions.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
export default class CompletionsRepository {
|
||||
async queryTabs(keywords, excludePinned) {
|
||||
let tabs = await browser.tabs.query({ currentWindow: true });
|
||||
return tabs.filter((t) => {
|
||||
return t.url.toLowerCase().includes(keywords.toLowerCase()) ||
|
||||
t.title && t.title.toLowerCase().includes(keywords.toLowerCase());
|
||||
}).filter((t) => {
|
||||
return !(excludePinned && t.pinned);
|
||||
});
|
||||
}
|
||||
}
|
Reference in a new issue