mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-09 05:04:46 +01:00
Activated settings migration to 0.3
This commit is contained in:
parent
74863d3c98
commit
d787b84b13
@ -149,7 +149,7 @@
|
||||
},
|
||||
{
|
||||
name: "storageVersion",
|
||||
defaultValue: 0.2,
|
||||
defaultValue: 0.3,
|
||||
fixed: true
|
||||
}
|
||||
];
|
||||
|
@ -493,31 +493,42 @@
|
||||
|
||||
var urlSettings = {};
|
||||
|
||||
(oldStorage.blackList || "").split(",").forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, blockMode: "block"};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
});
|
||||
(oldStorage.whiteList || "").split(",").forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, blockMode: "allow"};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
});
|
||||
(oldStorage.ignoreList || "").split(",").forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, showNotifications: false};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
else {
|
||||
entry.showNotifications = false;
|
||||
(oldStorage.blackList || "").split(",")
|
||||
.filter(function(url){return !!url.trim();})
|
||||
.forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, blockMode: "block"};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
});
|
||||
(oldStorage.whiteList || "").split(",")
|
||||
.filter(function(url){return !!url.trim();})
|
||||
.forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, blockMode: "allow"};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
});
|
||||
(oldStorage.ignoreList || "").split(",")
|
||||
.filter(function(url){return !!url.trim();})
|
||||
.forEach(function(url){
|
||||
var entry = urlSettings[url];
|
||||
if (!entry){
|
||||
entry = {url, showNotifications: false};
|
||||
urlSettings[url] = entry;
|
||||
newStorage.urlSettings.push(entry);
|
||||
}
|
||||
else {
|
||||
entry.showNotifications = false;
|
||||
}
|
||||
});
|
||||
["whiteList", "blackList", "ignoreList"].forEach(function(list){
|
||||
if (oldStorage.hasOwnProperty(list)){
|
||||
newStorage[list] = "";
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user