1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-02 23:57:10 +02:00

Safari: seamless transfer of settings to proper storage

This commit is contained in:
Chris 2015-03-14 18:13:00 -06:00
parent 441c1dd822
commit 2d30b04973

View File

@ -105,6 +105,16 @@
size: storageQuota,
storeName: "keyvaluepairs"
});
var oldSettings = safari.extension.settings; // To smoothly transition users
if(oldSettings.hasOwnProperty("version")) { // Old 'storage'!
for(var key in oldSettings) {
if(!oldSettings.hasOwnProperty(key) || key === "open_prefs") {
continue;
}
localforage.setItem(key, oldSettings[key]);
}
oldSettings.clear();
}
vAPI.storage = {
QUOTA_BYTES: storageQuota, // copied from Info.plist