Compare commits

..

22 Commits

Author SHA1 Message Date
luke crouch 66be5e288d Merge pull request #1950 from mozilla/version-bump
Bump version from 7.2.0 to 7.3.0
2021-01-22 09:37:27 -06:00
Maxx Crawford 7ebed4521d Bump version from 7.2.0 to 7.3.0 2021-01-22 09:30:17 -06:00
luke crouch 68b1b2fe37 Merge pull request #1608 from sryze/container-reordering
Implement container reordering
2021-01-22 09:14:52 -06:00
Sergey Zolotarev 89719f7243 Implement container reordering 2021-01-21 23:59:31 +06:00
luke crouch f4bcd30434 Merge pull request #1947 from mozilla/1946-minor-release-bump
Fix #1946 - Update package.json/manifest to 7.2.0
2021-01-11 11:24:11 -06:00
Maxx Crawford c2ff3f00f2 Fix #1946 - Update package.json/manifest to 7.2.0 2021-01-11 10:16:53 -06:00
Maxx Crawford 6494b98157 Merge pull request #1945 from mozilla/update-web-ext
update web-ext to 5.4.1
2021-01-11 10:13:36 -06:00
luke crouch c371cd11d0 update web-ext to 5.4.1 2021-01-11 09:33:08 -06:00
luke crouch 1b22753811 Merge pull request #1751 from JakeWharton/patch-1
Remove automatic capitalization of container name
2021-01-11 09:22:07 -06:00
Maxx Crawford e7af96b625 Merge pull request #1944 from dannycolin/dark-mode
Add a dark mode to MAC
2021-01-11 09:16:05 -06:00
Danny Colin 0c04b83207 fix css indentations 2021-01-10 19:02:42 -05:00
Danny Colin 6b73cee79e fix gradient colors in open tabs list 2021-01-10 18:59:16 -05:00
Danny Colin d7688cb1f5 fix stylelint errors 2021-01-08 13:19:18 -05:00
Danny Colin c03df9d246 add a dark theme 2021-01-08 13:11:02 -05:00
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
Jake Wharton 9c80781e3f Remove automatic capitalization of container name
The name is not capitalized in the address bar or the list of names in the extension popup.
2020-05-27 14:36:18 -04:00
10 changed files with 229 additions and 21 deletions
+3 -3
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.2",
"version": "7.3.0",
"author": "Andrea Marchesini, Luke Crouch and Jonathan Kingston",
"bugs": {
"url": "https://github.com/mozilla/multi-account-containers/issues"
@@ -22,10 +22,10 @@
"nyc": "^15.0.0",
"sinon": "^7.5.0",
"sinon-chai": "^3.3.0",
"stylelint-order": "^4.0.0",
"stylelint": "^13.5.0",
"stylelint-config-standard": "^20.0.0",
"web-ext": "^2.9.3",
"stylelint-order": "^4.0.0",
"web-ext": "^5.4.1",
"webextensions-jsdom": "^1.2.1"
},
"homepage": "https://github.com/mozilla/multi-account-containers#readme",
-1
View File
@@ -18,7 +18,6 @@ main {
button .container-name,
#current-container-name {
font-weight: bold;
text-transform: capitalize;
}
@media only screen and (max-width: 1300px) {
+116
View File
@@ -691,6 +691,10 @@ h3.title {
max-inline-size: 300px;
}
.menu-item.drag-over td {
border-block-start: 2px solid var(--text-normal-color);
}
.disabled-menu-item {
color: grey;
cursor: default;
@@ -931,3 +935,115 @@ tr > td > .trash-button {
tr:hover > td > .trash-button {
display: block;
}
.move-button {
cursor: move;
display: inline-block;
height: 100%;
inline-size: 16px;
margin-block-end: 4px;
margin-block-start: 4px;
margin-inline-end: 10px;
margin-inline-start: auto;
text-align: center;
}
.move-button > img {
height: 16px;
}
@media (prefers-color-scheme: dark) {
:root {
--title-text-color: #fff;
--text-normal-color: #f9f9fa;
--text-heading-color: #fff;
}
html {
background-color: #4a4a4a;
}
body {
color: #fff;
--hr-grey: #38383d;
--text-grey: #f9f9fa;
}
h3.title {
color: #fff;
}
.bottom-btn {
background-color: #737373;
border: solid 1px #737373;
}
.btn-return.arrow-left {
background-color: transparent;
}
.onboarding-title,
.delete-container-confirm-title {
color: #ededf0;
}
input {
border: solid 1px #737373;
}
#edit-container-panel-name-input {
background-color: #38383d;
color: #fff;
}
.delete-container {
background-color: #4a4a4a;
}
.delete-btn {
background-color: #737373;
color: #f9f9fa;
}
.cancel-button,
.grey-button {
background-color: #737373;
color: #fff;
}
.button.secondary:hover,
.button.secondary:focus {
background-color: #676767;
}
.panel-footer {
border-block-end: solid 1px #4a4a4a;
}
img.menu-icon,
.menu-icon > img,
.menu-arrow > img,
.info-icon > img,
.btn-return.arrow-left {
filter: invert(1);
}
#edit-sites-assigned .menu-icon,
#container-info-table .menu-icon {
filter: invert(0);
}
.truncate-text::after {
background: #4a4a4a;
mask-image: linear-gradient(to right, transparent, #4a4a4a 70%);
}
[data-identity-color="grey"] {
--identity-icon-color: #ededf0;
}
[type="radio"]:checked + [data-identity-color="grey"] {
--identity-icon-color: #616161;
}
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><script xmlns=""/>
<defs/>
<g id="All" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="hamburger-menu" fill="#858585">
<g id="Group" transform="translate(2.000000, 6.000000)">
<rect id="Rectangle-path" x="0" y="0" width="26" height="2"/>
<rect id="Rectangle-path" x="0" y="8" width="26" height="2"/>
<rect id="Rectangle-path" x="0" y="16" width="26" height="2"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 706 B

+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++) {
+69 -4
View File
@@ -10,6 +10,8 @@ const DEFAULT_ICON = "circle";
const NEW_CONTAINER_ID = "new";
const ONBOARDING_STORAGE_KEY = "onboarding-stage";
const CONTAINER_ORDER_STORAGE_KEY = "container-order";
const CONTAINER_DRAG_DATA_TYPE = "firefox-container";
// List of panels
const P_ONBOARDING_1 = "onboarding1";
@@ -192,16 +194,29 @@ const Logic = {
elementToEnable.classList.remove("disabled-menu-item");
},
async saveContainerOrder(rows) {
const containerOrder = {};
rows.forEach((node, index) => {
return containerOrder[node.dataset.containerId] = index;
});
await browser.storage.local.set({
[CONTAINER_ORDER_STORAGE_KEY]: containerOrder
});
},
async refreshIdentities() {
const [identities, state] = await Promise.all([
const [identities, state, containerOrderStorage] = await Promise.all([
browser.contextualIdentities.query({}),
browser.runtime.sendMessage({
method: "queryIdentitiesState",
message: {
windowId: browser.windows.WINDOW_ID_CURRENT
}
})
}),
browser.storage.local.get([CONTAINER_ORDER_STORAGE_KEY])
]);
const containerOrder =
containerOrderStorage && containerOrderStorage[CONTAINER_ORDER_STORAGE_KEY];
this._identities = identities.map((identity) => {
const stateObject = state[identity.cookieStoreId];
if (stateObject) {
@@ -211,8 +226,11 @@ const Logic = {
identity.numberOfOpenTabs = stateObject.numberOfOpenTabs;
identity.isIsolated = stateObject.isIsolated;
}
if (containerOrder) {
identity.order = containerOrder[identity.cookieStoreId];
}
return identity;
});
}).sort((i1, i2) => i1.order - i2.order);
},
getPanelSelector(panel) {
@@ -1006,12 +1024,59 @@ Logic.registerPanel(MANAGE_CONTAINERS_PICKER, {
data-identity-color="${identity.color}">
</div>
</div>
<span class="menu-text">${identity.name}</span>`;
<span class="menu-text">${identity.name}</span>
<span class="move-button">
<img
class="pop-button-image"
src="/img/container-move.svg"
/>
</span>`;
fragment.appendChild(tr);
tr.appendChild(td);
tr.draggable = true;
tr.dataset.containerId = identity.cookieStoreId;
tr.addEventListener("dragstart", (e) => {
e.dataTransfer.setData(CONTAINER_DRAG_DATA_TYPE, identity.cookieStoreId);
});
tr.addEventListener("dragover", (e) => {
if (e.dataTransfer.types.includes(CONTAINER_DRAG_DATA_TYPE)) {
tr.classList.add("drag-over");
e.preventDefault();
}
});
tr.addEventListener("dragenter", (e) => {
if (e.dataTransfer.types.includes(CONTAINER_DRAG_DATA_TYPE)) {
e.preventDefault();
tr.classList.add("drag-over");
}
});
tr.addEventListener("dragleave", (e) => {
if (e.dataTransfer.types.includes(CONTAINER_DRAG_DATA_TYPE)) {
e.preventDefault();
tr.classList.remove("drag-over");
}
});
tr.addEventListener("drop", async (e) => {
e.preventDefault();
const parent = tr.parentNode;
const containerId = e.dataTransfer.getData(CONTAINER_DRAG_DATA_TYPE);
let droppedElement;
parent.childNodes.forEach((node) => {
if (node.dataset.containerId === containerId) {
droppedElement = node;
}
});
if (droppedElement && droppedElement !== tr) {
tr.classList.remove("drag-over");
parent.insertBefore(droppedElement, tr);
await Logic.saveContainerOrder(parent.childNodes);
await Logic.refreshIdentities();
}
});
Utils.addEnterHandler(tr, () => {
pickedFunction(identity);
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Firefox Multi-Account Containers",
"version": "7.0.2",
"version": "7.3.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();