See if we have any backups, and if not, create one right away. This
is more robust than checking localStorage.lastBackupTime directly as
that isn't used anywhere else. Plus, MV3 won't support it.
localStorage.prefsBackupTimer = "30";
}
-if (!localStorage.lastBackupTime) {
- localStorage.lastBackupTime = -1;
+// Create a backup on first install (or if storage is wiped for some reason).
+chrome.storage.local.get("backups_list", function(items) {
+ if (items.backups_list) {
+ return;
+ }
// Create a backup now
var d = new Date();
backupNow(true, formattedDate, function(success, backupName, backupObj) {
// backup completed
});
-}
+});
function initAlarm () {
//console.log("initAlarm");