Skip to content

Commit

Permalink
Fix #1958 - Propagate container list reordering in Firefox menus
Browse files Browse the repository at this point in the history
Since Fx 123, we have a new API (contextualIdentities.move) that let
us reorder the container list everywhere in Firefox. This patch
looks if the API is supported by the client and propagate the change
if it's the case.
  • Loading branch information
dannycolin committed Feb 13, 2024
1 parent 018b458 commit 7305b54
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ const Logic = {
async saveContainerOrder(rows) {
const containerOrder = {};
rows.forEach((node, index) => {
if (typeof browser.contextualIdentities.move === "function") {
browser.contextualIdentities.move(
node.dataset.containerId, index);
}

return containerOrder[node.dataset.containerId] = index;
});
await browser.storage.local.set({
Expand Down

0 comments on commit 7305b54

Please sign in to comment.