1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 12:36:37 +02:00

Introduced stackList.

This commit is contained in:
kkapsner 2015-12-31 13:37:27 +01:00
parent 24d67113d6
commit d2f5a0cca1
6 changed files with 112 additions and 24 deletions

View file

@ -69,6 +69,32 @@ Object.keys(lists).forEach(function(type){
updateList(type);
});
function updateStackList(){
try {
var data = JSON.parse(prefs.stackList);
if (!Array.isArray(data)){
data = [data];
}
var list = data.filter(function(entry){
return typeof entry === "object" && typeof entry.url === "string";
});
}
catch(e){
var list = [];
}
list.match = function(stack){
return this.some(function(stackRule){
return stack.match(stackRule);
});
};
lists.stack = list;
}
lists.stack = [];
preferences.on("stackList", function(){
updateStackList();
});
updateStackList();
exports.get = function getList(type){
"use strict";