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.
This commit is contained in:
Danny Colin 2024-02-13 13:55:18 -05:00
parent 018b458ef6
commit 7305b54635

View file

@ -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({