From 7305b54635ec0cc6922ad7f605b60595d543807e Mon Sep 17 00:00:00 2001 From: Danny Colin Date: Tue, 13 Feb 2024 13:55:18 -0500 Subject: [PATCH] Fix #1958 - Propagate container list reordering in Firefox menus 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. --- src/js/popup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/popup.js b/src/js/popup.js index 236e393e..72792301 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -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({