mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-02 17:19:38 +02:00
code review
This commit is contained in:
parent
a9ce435f1c
commit
24611bab29
@ -136,6 +136,15 @@
|
|||||||
var availableLists = {};
|
var availableLists = {};
|
||||||
var relocationMap = {};
|
var relocationMap = {};
|
||||||
|
|
||||||
|
var fixLocation = function(location) {
|
||||||
|
// https://github.com/gorhill/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 onSelectedListsLoaded = function(store) {
|
var onSelectedListsLoaded = function(store) {
|
||||||
var µb = µBlock;
|
var µb = µBlock;
|
||||||
@ -185,16 +194,10 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
entry = locations[location];
|
entry = locations[location];
|
||||||
// https://github.com/gorhill/uBlock/issues/418
|
location = fixLocation(location);
|
||||||
// We now support built-in external filter lists
|
|
||||||
if ( /^https?:/.test(location) === false ) {
|
|
||||||
location = 'assets/thirdparties/' + location;
|
|
||||||
}
|
|
||||||
// Migrate obsolete location to new location, if any
|
// Migrate obsolete location to new location, if any
|
||||||
if ( typeof entry.oldLocation === 'string' ) {
|
if ( typeof entry.oldLocation === 'string' ) {
|
||||||
if ( /^https?:/.test(entry.oldLocation) === false ) {
|
entry.oldLocation = fixLocation(entry.oldLocation);
|
||||||
entry.oldLocation = 'assets/thirdparties/' + entry.oldLocation;
|
|
||||||
}
|
|
||||||
relocationMap[entry.oldLocation] = location;
|
relocationMap[entry.oldLocation] = location;
|
||||||
}
|
}
|
||||||
availableLists[location] = entry;
|
availableLists[location] = entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user