Excluding containers from sync with RegExp

This commit is contained in:
BPower0036 2023-07-07 09:34:49 +00:00 committed by GitHub
parent e3091dad7f
commit 0793e4ee09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,7 @@ const backgroundLogic = {
browser.permissions.onAdded.addListener(permissions => this.resetPermissions(permissions));
browser.permissions.onRemoved.addListener(permissions => this.resetPermissions(permissions));
backgroundLogic.setSyncExclusion();
// Update Translation in Manifest
browser.runtime.onInstalled.addListener(this.updateTranslationInManifest);
@ -504,6 +505,17 @@ const backgroundLogic = {
cookieStoreId(userContextId) {
if(userContextId === 0) return "firefox-default";
return `firefox-container-${userContextId}`;
},
async setSyncExclusion() {
// Default container sync exclude regexp to "^tmp\d+$" to prevent
// https://github.com/mozilla/multi-account-containers/issues/1675
// https://github.com/stoically/temporary-containers/issues/371
// for future users of the MAC + TC combination.
const { syncExcludeRegExp } = await browser.storage.local.get("syncExcludeRegExp");
if (syncExcludeRegExp === undefined) {
browser.storage.local.set({syncExcludeRegExp: "^tmp\\d+$"});
}
}
};