1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 11:22:38 +01:00

code review: overwrite list title only for external filter lists

This commit is contained in:
gorhill 2015-12-13 18:00:43 -05:00
parent 6d102b648a
commit a2fb13653a

View File

@ -458,7 +458,7 @@
var listMeta = µb.remoteBlacklists[path]; var listMeta = µb.remoteBlacklists[path];
// https://github.com/gorhill/uBlock/issues/313 // https://github.com/gorhill/uBlock/issues/313
// Always try to fetch the name if this is an external filter list. // Always try to fetch the name if this is an external filter list.
if ( listMeta && listMeta.title === '' || /^https?:/.test(path) ) { if ( listMeta && (listMeta.title === '' || listMeta.group === 'custom') ) {
var matches = details.content.slice(0, 1024).match(/(?:^|\n)!\s*Title:([^\n]+)/i); var matches = details.content.slice(0, 1024).match(/(?:^|\n)!\s*Title:([^\n]+)/i);
if ( matches !== null ) { if ( matches !== null ) {
listMeta.title = matches[1].trim(); listMeta.title = matches[1].trim();