Excluding containers from sync with RegExp

This commit is contained in:
BPower0036 2023-07-07 09:27:26 +00:00 committed by GitHub
parent 647d4ee03b
commit e3091dad7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);