Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0afc0da36 | |||
| fc070b2d0d | |||
| 899476e81a | |||
| 518f1cca89 | |||
| 997fe4db12 | |||
| a5f6f8381a | |||
| 46d76dfaa3 | |||
| 00a1ce9dca | |||
| b6f3c15999 | |||
| 024fb03c33 |
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "testpilot-containers",
|
"name": "testpilot-containers",
|
||||||
"title": "Multi-Account 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.",
|
"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",
|
"author": "Andrea Marchesini, Luke Crouch and Jonathan Kingston",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/mozilla/multi-account-containers/issues"
|
"url": "https://github.com/mozilla/multi-account-containers/issues"
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ window.assignManager = {
|
|||||||
return !!syncEnabled;
|
return !!syncEnabled;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async getReplaceTabEnabled() {
|
||||||
|
const { replaceTabEnabled } = await browser.storage.local.get("replaceTabEnabled");
|
||||||
|
return !!replaceTabEnabled;
|
||||||
|
},
|
||||||
|
|
||||||
getByUrlKey(siteStoreKey) {
|
getByUrlKey(siteStoreKey) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.area.get([siteStoreKey]).then((storageResponse) => {
|
this.area.get([siteStoreKey]).then((storageResponse) => {
|
||||||
@@ -233,9 +238,11 @@ window.assignManager = {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const replaceTabEnabled = await this.storageArea.getReplaceTabEnabled();
|
||||||
const removeTab = backgroundLogic.NEW_TAB_PAGES.has(tab.url)
|
const removeTab = backgroundLogic.NEW_TAB_PAGES.has(tab.url)
|
||||||
|| (messageHandler.lastCreatedTab
|
|| (messageHandler.lastCreatedTab
|
||||||
&& messageHandler.lastCreatedTab.id === tab.id);
|
&& messageHandler.lastCreatedTab.id === tab.id)
|
||||||
|
|| replaceTabEnabled;
|
||||||
const openTabId = removeTab ? tab.openerTabId : tab.id;
|
const openTabId = removeTab ? tab.openerTabId : tab.id;
|
||||||
|
|
||||||
if (!this.canceledRequests[tab.id]) {
|
if (!this.canceledRequests[tab.id]) {
|
||||||
|
|||||||
+10
-10
@@ -16,25 +16,24 @@ async function requestPermissions() {
|
|||||||
|
|
||||||
async function enableDisableSync() {
|
async function enableDisableSync() {
|
||||||
const checkbox = document.querySelector("#syncCheck");
|
const checkbox = document.querySelector("#syncCheck");
|
||||||
if (checkbox.checked) {
|
await browser.storage.local.set({syncEnabled: !!checkbox.checked});
|
||||||
await browser.storage.local.set({syncEnabled: true});
|
|
||||||
} else {
|
|
||||||
await browser.storage.local.set({syncEnabled: false});
|
|
||||||
}
|
|
||||||
browser.runtime.sendMessage({ method: "resetSync" });
|
browser.runtime.sendMessage({ method: "resetSync" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function enableDisableReplaceTab() {
|
||||||
|
const checkbox = document.querySelector("#replaceTabCheck");
|
||||||
|
await browser.storage.local.set({replaceTabEnabled: !!checkbox.checked});
|
||||||
|
}
|
||||||
|
|
||||||
async function setupOptions() {
|
async function setupOptions() {
|
||||||
const hasPermission = await browser.permissions.contains({permissions: ["bookmarks"]});
|
const hasPermission = await browser.permissions.contains({permissions: ["bookmarks"]});
|
||||||
const { syncEnabled } = await browser.storage.local.get("syncEnabled");
|
const { syncEnabled } = await browser.storage.local.get("syncEnabled");
|
||||||
|
const { replaceTabEnabled } = await browser.storage.local.get("replaceTabEnabled");
|
||||||
if (hasPermission) {
|
if (hasPermission) {
|
||||||
document.querySelector("#bookmarksPermissions").checked = true;
|
document.querySelector("#bookmarksPermissions").checked = true;
|
||||||
}
|
}
|
||||||
if (syncEnabled) {
|
document.querySelector("#syncCheck").checked = !!syncEnabled;
|
||||||
document.querySelector("#syncCheck").checked = true;
|
document.querySelector("#replaceTabCheck").checked = !!replaceTabEnabled;
|
||||||
} else {
|
|
||||||
document.querySelector("#syncCheck").checked = false;
|
|
||||||
}
|
|
||||||
setupContainerShortcutSelects();
|
setupContainerShortcutSelects();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +81,7 @@ function resetOnboarding() {
|
|||||||
document.addEventListener("DOMContentLoaded", setupOptions);
|
document.addEventListener("DOMContentLoaded", setupOptions);
|
||||||
document.querySelector("#bookmarksPermissions").addEventListener( "change", requestPermissions);
|
document.querySelector("#bookmarksPermissions").addEventListener( "change", requestPermissions);
|
||||||
document.querySelector("#syncCheck").addEventListener( "change", enableDisableSync);
|
document.querySelector("#syncCheck").addEventListener( "change", enableDisableSync);
|
||||||
|
document.querySelector("#replaceTabCheck").addEventListener( "change", enableDisableReplaceTab);
|
||||||
document.querySelector("button").addEventListener("click", resetOnboarding);
|
document.querySelector("button").addEventListener("click", resetOnboarding);
|
||||||
|
|
||||||
for (let i=0; i < NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
|
for (let i=0; i < NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
|
||||||
|
|||||||
+12
-6
@@ -30,6 +30,13 @@ const P_CONTAINER_DELETE = "containerDelete";
|
|||||||
const P_CONTAINERS_ACHIEVEMENT = "containersAchievement";
|
const P_CONTAINERS_ACHIEVEMENT = "containersAchievement";
|
||||||
const P_CONTAINER_ASSIGNMENTS = "containerAssignments";
|
const P_CONTAINER_ASSIGNMENTS = "containerAssignments";
|
||||||
|
|
||||||
|
function addRemoveSiteIsolation() {
|
||||||
|
const identity = Logic.currentIdentity();
|
||||||
|
browser.runtime.sendMessage({
|
||||||
|
method: "addRemoveSiteIsolation",
|
||||||
|
cookieStoreId: identity.cookieStoreId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function getExtensionInfo() {
|
async function getExtensionInfo() {
|
||||||
const manifestPath = browser.extension.getURL("manifest.json");
|
const manifestPath = browser.extension.getURL("manifest.json");
|
||||||
@@ -1242,6 +1249,9 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||||||
initialize() {
|
initialize() {
|
||||||
this.initializeRadioButtons();
|
this.initializeRadioButtons();
|
||||||
Utils.addEnterHandler(document.querySelector("#close-container-edit-panel"), () => {
|
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);
|
const formValues = new FormData(this._editForm);
|
||||||
if (formValues.get("container-id") !== NEW_CONTAINER_ID) {
|
if (formValues.get("container-id") !== NEW_CONTAINER_ID) {
|
||||||
this._submitForm();
|
this._submitForm();
|
||||||
@@ -1337,14 +1347,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||||||
containerName.select();
|
containerName.select();
|
||||||
containerName.focus();
|
containerName.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
const siteIsolation = document.querySelector("#site-isolation");
|
const siteIsolation = document.querySelector("#site-isolation");
|
||||||
siteIsolation.checked = !!identity.isIsolated;
|
siteIsolation.checked = !!identity.isIsolated;
|
||||||
siteIsolation.addEventListener( "change", function() {
|
siteIsolation.addEventListener( "change", addRemoveSiteIsolation, false);
|
||||||
browser.runtime.sendMessage({
|
|
||||||
method: "addRemoveSiteIsolation",
|
|
||||||
cookieStoreId: identity.cookieStoreId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
[...document.querySelectorAll("[name='container-color']")].forEach(colorInput => {
|
[...document.querySelectorAll("[name='container-color']")].forEach(colorInput => {
|
||||||
colorInput.checked = colorInput.value === identity.color;
|
colorInput.checked = colorInput.value === identity.color;
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Firefox Multi-Account Containers",
|
"name": "Firefox Multi-Account Containers",
|
||||||
"version": "7.0.1",
|
"version": "7.1.0",
|
||||||
"incognito": "not_allowed",
|
"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.",
|
"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": {
|
"icons": {
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
Enable Sync
|
Enable Sync
|
||||||
</label>
|
</label>
|
||||||
<p><em>This setting allows you to sync your containers and site assignments across devices.</em></p>
|
<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>
|
<h3>Keyboard Shortcuts:</h3>
|
||||||
<p><em>Edit which container is opened when using the numbered shortcuts.</em></p>
|
<p><em>Edit which container is opened when using the numbered shortcuts.</em></p>
|
||||||
<p><label>
|
<p><label>
|
||||||
|
|||||||
+2
-1
@@ -87,7 +87,8 @@ const initializeWithTab = async (details = {
|
|||||||
"browserActionBadgesClicked": [],
|
"browserActionBadgesClicked": [],
|
||||||
"onboarding-stage": 7,
|
"onboarding-stage": 7,
|
||||||
"achievements": [],
|
"achievements": [],
|
||||||
"syncEnabled": true
|
"syncEnabled": true,
|
||||||
|
"replaceTabEnabled": false
|
||||||
});
|
});
|
||||||
window.browser.storage.local.set.resetHistory();
|
window.browser.storage.local.set.resetHistory();
|
||||||
window.browser.storage.sync.clear();
|
window.browser.storage.sync.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user