From e3091dad7fd3287c9470944446eb159354aacd1a Mon Sep 17 00:00:00 2001 From: BPower0036 <80090789+BPower0036@users.noreply.github.com> Date: Fri, 7 Jul 2023 09:27:26 +0000 Subject: [PATCH] Excluding containers from sync with RegExp --- src/js/background/sync.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/background/sync.js b/src/js/background/sync.js index 6dfb629..fc6d875 100644 --- a/src/js/background/sync.js +++ b/src/js/background/sync.js @@ -128,9 +128,16 @@ const sync = { await sync.checkForListenersMaybeAdd(); async function updateSyncIdentities() { + const { syncExcludeRegExp } = await browser.storage.local.get("syncExcludeRegExp"); + const excludeRegExp = new RegExp(syncExcludeRegExp, "i"); const identities = await browser.contextualIdentities.query({}); for (const identity of identities) { + // skip excluded identities + if (identity.name.match(excludeRegExp)) { + continue; + } + delete identity.colorCode; delete identity.iconUrl; identity.macAddonUUID = await identityState.lookupMACaddonUUID(identity.cookieStoreId);