From: Mike Frysinger Date: Sun, 10 Dec 2023 03:07:28 +0000 (-0700) Subject: backup: filter out chrome-untrusted:// windows X-Git-Tag: v1.0~6 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e11f333839482b8ae67de1f4a8273b0eb058ef1b;p=chrome-ext%2Ftabs-backup.git backup: filter out chrome-untrusted:// windows I don't think any of these should be backed up. --- diff --git a/background.js b/background.js index 4ba12fa..da06677 100644 --- a/background.js +++ b/background.js @@ -193,6 +193,11 @@ function backupNow(isAutomatic, backupName, callbackDone) { //console.log("==> Tab " + j + " (" + tab.index + "): " + tabUrl); + // Ignore windows that we can't/shouldn't backup. + if (tab.url.startsWith('chrome-untrusted://')) { + continue; + } + var bkpTab = { url: tab.url, title: tab.title, @@ -204,9 +209,11 @@ function backupNow(isAutomatic, backupName, callbackDone) { bkpWindow.tabs.push(bkpTab); } - totNumTabs += windowTabs.length; + if (bkpWindow.tabs.length) { + totNumTabs += bkpWindow.tabs.length; - fullBackup.windows.push(bkpWindow); + fullBackup.windows.push(bkpWindow); + } } if (totNumTabs == 0)