From 1f779f9c2ce766b278cb4e4fb3eeafaa8f7897f2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 7 Oct 2022 23:55:27 +0545 Subject: [PATCH] update to MV3 --- background.js | 23 +---------------------- manifest.json | 12 ++++++------ 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/background.js b/background.js index 1bae018..4ba12fa 100644 --- a/background.js +++ b/background.js @@ -1,24 +1,3 @@ -// Migrate old localStorage to chrome.storage.local. -if (localStorage.prefsMaxBackupItems !== undefined) { - chrome.storage.local.set({ - prefs_max_backup_items: parseInt(localStorage.prefsMaxBackupItems), - }); - localStorage.removeItem("prefsMaxBackupItems"); -} -if (localStorage.prefsBackupTimer !== undefined) { - chrome.storage.local.set({ - prefs_backup_timer: parseInt(localStorage.prefsBackupTimer), - }); - localStorage.removeItem("prefsBackupTimer"); -} -if (localStorage.prefsTheme !== undefined) { - chrome.storage.local.set({ - prefs_theme: localStorage.prefsTheme, - }); - localStorage.removeItem("prefsTheme"); -} -localStorage.removeItem("lastBackupTime"); - // Create a backup on first install (or if storage is wiped for some reason. chrome.storage.local.get(function(items) { // Setup defaults. @@ -304,7 +283,7 @@ function updateBrowserActionIcon (status) { break; } - chrome.browserAction.setIcon({path: icon}); + chrome.action.setIcon({path: icon}); } function deleteBackup (backupName, callback) { diff --git a/manifest.json b/manifest.json index 6efd316..3441cd8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,20 +1,20 @@ { "name": "vapier tabs backup", - "version": "0.3", - "manifest_version": 2, + "version": "1.0", + "manifest_version": 3, "description": "With 'Tabs Backup & Restore' you will never lose your work again! Backup an entire Chrome session (windows and tabs).", "icons": { "16": "icon_16.png", "48": "icon_48.png", "128": "icon_128.png" }, "background": { - "persistent": false, - "scripts": ["background.js"] + "service_worker": "background.js", + "type": "module" }, "options_ui": { "page": "options.html", - "chrome_style": true + "open_in_tab": false }, - "browser_action": { + "action": { "default_icon": "icon_48.png", "default_popup": "popup.html" }, -- 2.39.5