1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-03 03:56:26 +02:00

Added search field to browser page popup

Fixes #268
This commit is contained in:
kkapsner 2018-10-09 12:59:53 +02:00
parent f5699a1bf3
commit eff86ce4ed
6 changed files with 40 additions and 7 deletions

View file

@ -57,13 +57,16 @@
window.setTimeout(() => node.focus(), 1);
let lastResults = [];
node.addEventListener("input", function(){
this.search();
});
node.search = function(){
const search = this.value;
const results = search? scope.search(search): [];
searchListeners.forEach(function(callback){
callback({search, results, lastResults});
});
lastResults = results;
});
};
return node;
};
scope.on = function(callback){