commit 4045c34e2a4bac56ead31054839e12a90c504af3
parent 0c5162be20606aa17350019b9147c29cd01da16c
Author: Mark Hammond <mhammond@skippinet.com.au>
Date: Sat, 22 Nov 2025 02:31:44 +0000
Bug 2001300 - fix double separators for send-tab context menu. r=skhamis
I missed this because apparently native context menus on Mac auto hide dupe separators.
Differential Revision: https://phabricator.services.mozilla.com/D273615
Diffstat:
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/browser/base/content/browser-sync.js b/browser/base/content/browser-sync.js
@@ -2009,10 +2009,10 @@ var gSync = {
let sendTabToDeviceSeparator = document.getElementById(
"context_sendTabToDeviceSeparator"
);
- sendTabToDeviceSeparator.disabled = !enabled;
if (hideItems || !hasASendableURI) {
sendTabsToDevice.hidden = true;
+ sendTabToDeviceSeparator.hidden = true;
} else {
let tabCount = aTargetTab.multiselected
? gBrowser.multiSelectedTabsCount
@@ -2022,6 +2022,7 @@ var gSync = {
JSON.stringify({ tabCount })
);
sendTabsToDevice.hidden = false;
+ sendTabToDeviceSeparator.hidden = false;
}
},
diff --git a/browser/base/content/test/sync/browser_contextmenu_sendtab.js b/browser/base/content/test/sync/browser_contextmenu_sendtab.js
@@ -178,6 +178,11 @@ add_task(async function test_tab_contextmenu() {
"Send tab to device is shown"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ false,
+ "Send tab to device separator is shown"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
false,
"Send tab to device is enabled"
@@ -200,6 +205,11 @@ add_task(async function test_tab_contextmenu_unconfigured() {
"Send tab to device is hidden"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device separator is hidden"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
false,
"Send tab to device is enabled"
@@ -218,6 +228,11 @@ add_task(async function test_tab_contextmenu_not_sendable() {
"Send tab to device is hidden"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device is hidden"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
true,
"Send tab to device is disabled"
@@ -236,6 +251,11 @@ add_task(async function test_tab_contextmenu_not_synced_yet() {
"Send tab to device is hidden"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device separator is hidden"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
true,
"Send tab to device is disabled"
@@ -254,6 +274,11 @@ add_task(async function test_tab_contextmenu_sync_not_ready_configured() {
"Send tab to device is hidden"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device is hidden"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
true,
"Send tab to device is disabled"
@@ -275,6 +300,11 @@ add_task(async function test_tab_contextmenu_sync_not_ready_other_state() {
"Send tab to device is hidden"
);
is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device separator is hidden"
+ );
+ is(
document.getElementById("context_sendTabToDevice").disabled,
false,
"Send tab to device is enabled"
@@ -294,6 +324,12 @@ add_task(async function test_tab_contextmenu_fxa_disabled() {
true,
"Send tab to device is hidden"
);
+ updateTabContextMenu(testTab);
+ is(
+ document.getElementById("context_sendTabToDeviceSeparator").hidden,
+ true,
+ "Send tab to device separator is hidden"
+ );
getter.restore();
[...document.querySelectorAll(".sync-ui-item")].forEach(