Skip to content

Commit

Permalink
Revert "Excluding containers from sync with RegExp"
Browse files Browse the repository at this point in the history
This reverts commit bf31fa9.
  • Loading branch information
dannycolin committed Nov 19, 2022
1 parent 06c8975 commit 8e7d9f7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 45 deletions.
10 changes: 0 additions & 10 deletions src/css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ form {
margin-block: 4px 8px;
}

.settings-group-column {
display: flex;
flex-direction: column;
}

.settings-group-column label,
.settings-group-column p {
margin-block: 4px 8px;
}

input[type="checkbox"] {
margin-inline: 0 8px;
margin-block: 1px auto;
Expand Down
12 changes: 0 additions & 12 deletions src/js/background/backgroundLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const backgroundLogic = {

browser.permissions.onAdded.addListener(permissions => this.resetPermissions(permissions));
browser.permissions.onRemoved.addListener(permissions => this.resetPermissions(permissions));
backgroundLogic.setSyncExclusion();
},

resetPermissions(permissions) {
Expand Down Expand Up @@ -400,17 +399,6 @@ 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+$"});
}
}
};

Expand Down
7 changes: 0 additions & 7 deletions src/js/background/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,9 @@ 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);
Expand Down
7 changes: 0 additions & 7 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ async function setupOptions() {
const { syncEnabled } = await browser.storage.local.get("syncEnabled");
const { replaceTabEnabled } = await browser.storage.local.get("replaceTabEnabled");
const { currentThemeId } = await browser.storage.local.get("currentThemeId");
const { syncExcludeRegExp } = await browser.storage.local.get("syncExcludeRegExp");

document.querySelector("#syncCheck").checked = !!syncEnabled;
document.querySelector("#replaceTabCheck").checked = !!replaceTabEnabled;
document.querySelector("#changeTheme").selectedIndex = currentThemeId;
document.querySelector("#syncExcludeRegExp").value = syncExcludeRegExp || "";
setupContainerShortcutSelects();
}

Expand Down Expand Up @@ -122,15 +120,10 @@ async function resetPermissionsUi() {
browser.permissions.onAdded.addListener(resetPermissionsUi);
browser.permissions.onRemoved.addListener(resetPermissionsUi);

function updateSyncExcludeRegExp(event) {
browser.storage.local.set({syncExcludeRegExp: event.target.value});
}

document.addEventListener("DOMContentLoaded", setupOptions);
document.querySelector("#syncCheck").addEventListener( "change", enableDisableSync);
document.querySelector("#replaceTabCheck").addEventListener( "change", enableDisableReplaceTab);
document.querySelector("#changeTheme").addEventListener( "change", changeTheme);
document.querySelector("#syncExcludeRegExp").addEventListener( "change", updateSyncExcludeRegExp);

maybeShowPermissionsWarningIcon();
for (let i=0; i < NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
Expand Down
9 changes: 0 additions & 9 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ <h3 data-i18n-message-id="firefoxAccountsSync"></h3>
</label>
<p><em data-i18n-message-id="enableSyncDescription"></em></p>
</div>
<div class="settings-group-column">
<label for="syncExcludeRegExp">
<span class="bold" data-i18n-message-id="syncExclude"></span>
</label>
<input id="syncExcludeRegExp"
data-i18n-attribute="placeholder"
data-i18n-attribute-message-id="syncExcludePlaceholder">
<p><em data-i18n-message-id="syncExcludeDescription"></em></p>
</div>

<h3 data-i18n-message-id="tabBehavior"></h3>

Expand Down

0 comments on commit 8e7d9f7

Please sign in to comment.