mirror of https://github.com/gorhill/uBlock.git
this fixes #313
This commit is contained in:
parent
c52b4bb780
commit
b51e951536
|
@ -39,7 +39,6 @@ var oneHour = 60 * oneMinute;
|
|||
|
||||
var defaultExternalLists = [
|
||||
'! Examples:',
|
||||
'! https://easylist-downloads.adblockplus.org/antiadblockfilters.txt',
|
||||
'! https://easylist-downloads.adblockplus.org/fb_annoyances_full.txt',
|
||||
'! https://easylist-downloads.adblockplus.org/fb_annoyances_sidebar.txt',
|
||||
'! https://easylist-downloads.adblockplus.org/fb_annoyances_newsfeed.txt',
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
//console.debug('µBlock.getCompiledFilterList/onRawListLoaded: compiling "%s"', path);
|
||||
details.content = µb.compileFilters(details.content);
|
||||
µb.assets.put(compiledPath, details.content);
|
||||
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);
|
||||
callback(details);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue