From: Mike Frysinger Date: Fri, 7 Oct 2022 18:10:27 +0000 (+0545) Subject: update to MV3 X-Git-Tag: v1.0~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1f779f9c2ce766b278cb4e4fb3eeafaa8f7897f2;p=chrome-ext%2Ftabs-backup.git update to MV3 --- 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" },