Add support for all list token in updater-link feature

Using `listkeys=all` will cause all enabled lists to be updated.
This commit is contained in:
Raymond Hill 2023-12-12 11:04:16 -05:00
parent 4305ea9c0c
commit 14926913f7
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -2115,9 +2115,12 @@ const onMessage = function(request, sender, callback) {
case 'updateLists':
const listkeys = request.listkeys.split(',').filter(s => s !== '');
if ( listkeys.length === 0 ) { return; }
for ( const listkey of listkeys ) {
io.purge(listkey);
io.remove(`compiled/${listkey}`);
if ( listkeys.includes('all') ) {
io.purge(/./, 'public_suffix_list.dat');
} else {
for ( const listkey of listkeys ) {
io.purge(listkey);
}
}
µb.scheduleAssetUpdater(0);
µb.openNewTab({