mirror of https://github.com/gorhill/uBlock.git
this fixes https://github.com/gorhill/uBlock/issues/134 and #1326
This commit is contained in:
parent
c283ff5879
commit
7a8612bfec
|
@ -16,7 +16,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
|
||||||
Home: https://github.com/chrisaljoudi/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global YaMD5, µBlock, vAPI, punycode, publicSuffixList */
|
/* global YaMD5, µBlock, vAPI, punycode, publicSuffixList */
|
||||||
|
@ -46,12 +46,6 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µBlock.keyvalSetMany = function(dict, callback) {
|
|
||||||
vAPI.storage.set(dict, callback || this.noopFunc);
|
|
||||||
};
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
µBlock.saveLocalSettings = function(force) {
|
µBlock.saveLocalSettings = function(force) {
|
||||||
if ( force ) {
|
if ( force ) {
|
||||||
this.localSettingsModifyTime = Date.now();
|
this.localSettingsModifyTime = Date.now();
|
||||||
|
@ -211,20 +205,25 @@
|
||||||
var lists = store.remoteBlacklists;
|
var lists = store.remoteBlacklists;
|
||||||
var locations = Object.keys(lists);
|
var locations = Object.keys(lists);
|
||||||
var location, availableEntry, storedEntry;
|
var location, availableEntry, storedEntry;
|
||||||
|
var off;
|
||||||
|
|
||||||
while ( location = locations.pop() ) {
|
while ( location = locations.pop() ) {
|
||||||
storedEntry = lists[location];
|
storedEntry = lists[location];
|
||||||
|
off = storedEntry.off === true;
|
||||||
// New location?
|
// New location?
|
||||||
if ( relocationMap.hasOwnProperty(location) ) {
|
if ( relocationMap.hasOwnProperty(location) ) {
|
||||||
µb.purgeFilterList(location);
|
µb.purgeFilterList(location);
|
||||||
location = relocationMap[location];
|
location = relocationMap[location];
|
||||||
|
if ( off && lists.hasOwnProperty(location) ) {
|
||||||
|
off = lists[location].off === true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
availableEntry = availableLists[location];
|
availableEntry = availableLists[location];
|
||||||
if ( availableEntry === undefined ) {
|
if ( availableEntry === undefined ) {
|
||||||
µb.purgeFilterList(location);
|
µb.purgeFilterList(location);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
availableEntry.off = storedEntry.off || false;
|
availableEntry.off = off;
|
||||||
µb.assets.setHomeURL(location, availableEntry.homeURL);
|
µb.assets.setHomeURL(location, availableEntry.homeURL);
|
||||||
if ( storedEntry.entryCount !== undefined ) {
|
if ( storedEntry.entryCount !== undefined ) {
|
||||||
availableEntry.entryCount = storedEntry.entryCount;
|
availableEntry.entryCount = storedEntry.entryCount;
|
||||||
|
@ -536,7 +535,7 @@
|
||||||
line = line.slice(0, pos).trim();
|
line = line.slice(0, pos).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/chrisaljoudi/httpswitchboard/issues/15
|
// https://github.com/gorhill/httpswitchboard/issues/15
|
||||||
// Ensure localhost et al. don't end up in the ubiquitous blacklist.
|
// Ensure localhost et al. don't end up in the ubiquitous blacklist.
|
||||||
// With hosts files, we need to remove local IP redirection
|
// With hosts files, we need to remove local IP redirection
|
||||||
if ( reMaybeLocalIp.test(c) ) {
|
if ( reMaybeLocalIp.test(c) ) {
|
||||||
|
|
Loading…
Reference in New Issue