Browse Source

support external stock hosts files

pull/2/head
gorhill 10 years ago
parent
commit
a2e5fd671e
  1. 15
      src/js/storage.js

15
src/js/storage.js

@ -95,6 +95,15 @@
var redirections = {}; var redirections = {};
var µm = this; var µm = this;
var fixLocation = function(location) {
// https://github.com/chrisaljoudi/uBlock/issues/418
// We now support built-in external filter lists
if ( /^https?:/.test(location) === false ) {
location = 'assets/thirdparties/' + location;
}
return location;
};
// selected lists // selected lists
var onSelectedHostsFilesLoaded = function(store) { var onSelectedHostsFilesLoaded = function(store) {
var lists = store.liveHostsFiles; var lists = store.liveHostsFiles;
@ -139,11 +148,7 @@
continue; continue;
} }
hostsFileEntry = locations[location]; hostsFileEntry = locations[location];
availableHostsFiles['assets/thirdparties/' + location] = hostsFileEntry;
if ( hostsFileEntry.old !== undefined ) {
redirections[hostsFileEntry.old] = location;
delete hostsFileEntry.old;
}
availableHostsFiles[fixLocation(location)] = hostsFileEntry;
} }
// Now get user's selection of lists // Now get user's selection of lists

Loading…
Cancel
Save