aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahielkasim@gmail.com>2019-10-15 12:03:26 +0400
committerRahiel Kasim <rahielkasim@gmail.com>2019-10-15 12:03:26 +0400
commite62a69b5ea4de91fa26abec00cf1a80ef0c80382 (patch)
treea7755b137652b6f095e932dcf872904ff8f63b96
parent44ea4c24ef41744a1a27649ed2707056551bf5cf (diff)
remove old migration code
-rw-r--r--src/archiveror.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/archiveror.js b/src/archiveror.js
index e84f8ac..4c9cd0a 100644
--- a/src/archiveror.js
+++ b/src/archiveror.js
@@ -428,47 +428,3 @@ function removeBookmark(id, removeInfo) {
}
}
chrome.bookmarks.onRemoved.addListener(removeBookmark);
-
-// Migration code
-chrome.runtime.onInstalled.addListener(function (details) {
- // Migrate deprecated "archiveMode" setting. TODO: remove this (from April 2018)
- let key = "archiveMode";
- chrome.storage.local.get({[key]: false, bookmarkServices: defaults.bookmarkServices}, function (items) {
- const archiveMode = items[key];
- if (archiveMode !== false) {
- if (archiveMode === "local") {
- let bookmarkServices = items.bookmarkServices;
- if (!bookmarkServices.includes("mhtml")) {
- bookmarkServices.push("mhtml");
- chrome.storage.local.set({bookmarkServices: bookmarkServices});
- }
- }
- chrome.storage.local.remove(key);
- }
- });
-
- // Migrate to new data format TODO: remove this (from May 2018)
- chrome.storage.local.get(null, function (items) {
- for (let k of Object.keys(items)) {
- if (typeof items[k] === "string") {
- let link = items[k];
- if (link.startsWith("http")) {
- items[k] = {"archive.is": link};
- }
- }
- }
- for (let k of Object.keys(items)) {
- if (k.startsWith("_")) {
- let url = k.slice(1);
- if (items.hasOwnProperty(url)) {
- items[url].mhtml = items[k];
- } else {
- items[url] = {"mhtml": items[k]};
- }
- delete items[k];
- chrome.storage.local.remove(k);
- }
- }
- chrome.storage.local.set(items);
- });
-});