Compare commits

...

10 Commits

Author SHA1 Message Date
luke crouch f0afc0da36 Merge pull request #1854 from mozilla/version-bump
Update version number for new release
2020-08-25 11:54:16 -05:00
Maxx Crawford fc070b2d0d Update version number for new release 2020-08-25 11:40:01 -05:00
luke crouch 899476e81a Merge pull request #1835 from Moonloard/replace-tab
Replace tab instead of creating a new one (#1765 #1704 #1590  #1837)
2020-08-14 11:11:19 -05:00
Moonloard 518f1cca89 option name adjusted 2020-07-27 22:49:33 +02:00
Moonloard 997fe4db12 description of option adjusted 2020-07-27 22:42:55 +02:00
Moonloard a5f6f8381a remove unnecessary line breaks 2020-07-27 22:22:42 +02:00
Moonloard 46d76dfaa3 new option to replace current tab when a assigned domain is opened 2020-07-27 22:12:49 +02:00
Maxx Crawford 00a1ce9dca Merge pull request #1815 from mozilla/1781-site-isolation-save-fix
Site isolation saved changes do not affect other containers
2020-07-16 21:09:30 -05:00
Maxx Crawford b6f3c15999 Bumped version number for patch 2020-07-15 10:42:08 -05:00
Maxx Crawford 024fb03c33 Fixed #1781 - Reset checkbox listener to keep event queue to 0 2020-07-15 10:41:12 -05:00
7 changed files with 41 additions and 20 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "testpilot-containers",
"title": "Multi-Account Containers",
"description": "Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate.",
"version": "7.0.1",
"version": "7.1.0",
"author": "Andrea Marchesini, Luke Crouch and Jonathan Kingston",
"bugs": {
"url": "https://github.com/mozilla/multi-account-containers/issues"
+8 -1
View File
@@ -51,6 +51,11 @@ window.assignManager = {
return !!syncEnabled;
},
async getReplaceTabEnabled() {
const { replaceTabEnabled } = await browser.storage.local.get("replaceTabEnabled");
return !!replaceTabEnabled;
},
getByUrlKey(siteStoreKey) {
return new Promise((resolve, reject) => {
this.area.get([siteStoreKey]).then((storageResponse) => {
@@ -233,9 +238,11 @@ window.assignManager = {
return {};
}
}
const replaceTabEnabled = await this.storageArea.getReplaceTabEnabled();
const removeTab = backgroundLogic.NEW_TAB_PAGES.has(tab.url)
|| (messageHandler.lastCreatedTab
&& messageHandler.lastCreatedTab.id === tab.id);
&& messageHandler.lastCreatedTab.id === tab.id)
|| replaceTabEnabled;
const openTabId = removeTab ? tab.openerTabId : tab.id;
if (!this.canceledRequests[tab.id]) {
+10 -10
View File
@@ -16,25 +16,24 @@ async function requestPermissions() {
async function enableDisableSync() {
const checkbox = document.querySelector("#syncCheck");
if (checkbox.checked) {
await browser.storage.local.set({syncEnabled: true});
} else {
await browser.storage.local.set({syncEnabled: false});
}
await browser.storage.local.set({syncEnabled: !!checkbox.checked});
browser.runtime.sendMessage({ method: "resetSync" });
}
async function enableDisableReplaceTab() {
const checkbox = document.querySelector("#replaceTabCheck");
await browser.storage.local.set({replaceTabEnabled: !!checkbox.checked});
}
async function setupOptions() {
const hasPermission = await browser.permissions.contains({permissions: ["bookmarks"]});
const { syncEnabled } = await browser.storage.local.get("syncEnabled");
const { replaceTabEnabled } = await browser.storage.local.get("replaceTabEnabled");
if (hasPermission) {
document.querySelector("#bookmarksPermissions").checked = true;
}
if (syncEnabled) {
document.querySelector("#syncCheck").checked = true;
} else {
document.querySelector("#syncCheck").checked = false;
}
document.querySelector("#syncCheck").checked = !!syncEnabled;
document.querySelector("#replaceTabCheck").checked = !!replaceTabEnabled;
setupContainerShortcutSelects();
}
@@ -82,6 +81,7 @@ function resetOnboarding() {
document.addEventListener("DOMContentLoaded", setupOptions);
document.querySelector("#bookmarksPermissions").addEventListener( "change", requestPermissions);
document.querySelector("#syncCheck").addEventListener( "change", enableDisableSync);
document.querySelector("#replaceTabCheck").addEventListener( "change", enableDisableReplaceTab);
document.querySelector("button").addEventListener("click", resetOnboarding);
for (let i=0; i < NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
+12 -6
View File
@@ -30,6 +30,13 @@ const P_CONTAINER_DELETE = "containerDelete";
const P_CONTAINERS_ACHIEVEMENT = "containersAchievement";
const P_CONTAINER_ASSIGNMENTS = "containerAssignments";
function addRemoveSiteIsolation() {
const identity = Logic.currentIdentity();
browser.runtime.sendMessage({
method: "addRemoveSiteIsolation",
cookieStoreId: identity.cookieStoreId
});
}
async function getExtensionInfo() {
const manifestPath = browser.extension.getURL("manifest.json");
@@ -1242,6 +1249,9 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
initialize() {
this.initializeRadioButtons();
Utils.addEnterHandler(document.querySelector("#close-container-edit-panel"), () => {
// Resets listener from siteIsolation checkbox to keep the update queue to 0.
const siteIsolation = document.querySelector("#site-isolation");
siteIsolation.removeEventListener("change", addRemoveSiteIsolation, false);
const formValues = new FormData(this._editForm);
if (formValues.get("container-id") !== NEW_CONTAINER_ID) {
this._submitForm();
@@ -1337,14 +1347,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
containerName.select();
containerName.focus();
});
const siteIsolation = document.querySelector("#site-isolation");
siteIsolation.checked = !!identity.isIsolated;
siteIsolation.addEventListener( "change", function() {
browser.runtime.sendMessage({
method: "addRemoveSiteIsolation",
cookieStoreId: identity.cookieStoreId
});
});
siteIsolation.addEventListener( "change", addRemoveSiteIsolation, false);
[...document.querySelectorAll("[name='container-color']")].forEach(colorInput => {
colorInput.checked = colorInput.value === identity.color;
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Firefox Multi-Account Containers",
"version": "7.0.1",
"version": "7.1.0",
"incognito": "not_allowed",
"description": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate.",
"icons": {
+7
View File
@@ -20,6 +20,13 @@
Enable Sync
</label>
<p><em>This setting allows you to sync your containers and site assignments across devices.</em></p>
<h3>Tab behaviour:</h3>
<label>
<input type="checkbox" id="replaceTabCheck">
Replace tab instead of creating a new one
</label>
<p><em>Replace the current tab if a page which is assigned to another container is opened (instead of keeping the current tab open).
Opening tabs with middle mouse button is not affected.</em></p>
<h3>Keyboard Shortcuts:</h3>
<p><em>Edit which container is opened when using the numbered shortcuts.</em></p>
<p><label>
+2 -1
View File
@@ -87,7 +87,8 @@ const initializeWithTab = async (details = {
"browserActionBadgesClicked": [],
"onboarding-stage": 7,
"achievements": [],
"syncEnabled": true
"syncEnabled": true,
"replaceTabEnabled": false
});
window.browser.storage.local.set.resetHistory();
window.browser.storage.sync.clear();