aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-06-08 08:09:08 -0400
committergorhill <rhill@raymondhill.net>2015-06-08 08:09:08 -0400
commitb51e951536170b3ee400143c8fa31d3f99e8f097 (patch)
tree52333c3274072c65a5d32d3775efda9e89147323 /src
parentc52b4bb780cd4d44235ddca2e7e6caea076c9334 (diff)
downloaduBlock-b51e951536170b3ee400143c8fa31d3f99e8f097.zip
uBlock-b51e951536170b3ee400143c8fa31d3f99e8f097.tar.gz
uBlock-b51e951536170b3ee400143c8fa31d3f99e8f097.tar.bz2
this fixes #313
Diffstat (limited to 'src')
-rw-r--r--src/js/background.js1
-rw-r--r--src/js/storage.js26
2 files changed, 15 insertions, 12 deletions
diff --git a/src/js/background.js b/src/js/background.js
index 2a6027e..428451e 100644
--- a/src/js/background.js
+++ b/src/js/background.js
@@ -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',
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);
};