diff options
Diffstat (limited to 'src/js/storage.js')
-rw-r--r-- | src/js/storage.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/js/storage.js b/src/js/storage.js index f3ab6a6..6c922e1 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -443,19 +443,23 @@ var µb = this; var onRawListLoaded = function(details) { - if ( details.content !== '' ) { - var listMeta = µb.remoteBlacklists[path]; - if ( listMeta && listMeta.title === '' ) { - var matches = details.content.slice(0, 1024).match(/(?:^|\n)!\s*Title:([^\n]+)/i); - if ( matches !== null ) { - listMeta.title = matches[1].trim(); - } + if ( details.content === '' ) { + callback(details); + return; + } + var listMeta = µb.remoteBlacklists[path]; + // https://github.com/gorhill/uBlock/issues/313 + // Always try to fetch the name if this is an external filter list. + if ( listMeta && listMeta.title === '' || /^https?:/.test(path) ) { + var matches = details.content.slice(0, 1024).match(/(?:^|\n)!\s*Title:([^\n]+)/i); + if ( matches !== null ) { + listMeta.title = matches[1].trim(); } - - //console.debug('µBlock.getCompiledFilterList/onRawListLoaded: compiling "%s"', path); - details.content = µb.compileFilters(details.content); - µb.assets.put(compiledPath, details.content); } + + //console.debug('µBlock.getCompiledFilterList/onRawListLoaded: compiling "%s"', path); + details.content = µb.compileFilters(details.content); + µb.assets.put(compiledPath, details.content); callback(details); }; |