Closed Bug 1417238 Opened 7 years ago Closed 5 years ago

"Open Link in New Container Tab" submenu active but empty when there are no containers

Categories

(Firefox :: Menus, defect, P3)

68 Branch
defect

Tracking

()

VERIFIED FIXED
Firefox 70
Tracking Status
firefox70 --- verified

People

(Reporter: 08xjcec48, Assigned: Gijs)

Details

(Whiteboard: [testday-20190719])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171112125346

Steps to reproduce:

- Go to about:preferences#containers and delete all containers
- Open example.org
- Right-click on the link


Actual results:

"Open Link in New Container Tab" is visible and not greyed-out, even though it has no purpose with no sub-entries.


Expected results:

When there are currently no containers, the ""Open Link in New Container Tab" entry in the link context menu should be greyed-out, or it should offer the option to create a new container, or show a link to "Manage containers" (about:preferences#containers).
Please report the issue to https://github.com/mozilla/multi-account-containers/issues Thank you!
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
This is a platform-level bug - not an issue with the add-on.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---
I'm thinking at two possible components for this issue: one is Core::XP Toolkit/Widgets: Menus and the other one is Firefox:: Menus. Since Containers is an add-on, I'm thinking this may not be a Core issue, but more like a Firefox issue. I'm going to move this to Firefox:: Menus for now, please correct me if I'm wrong.
Component: Untriaged → Menus
Jonathan, is this something you would be interested in?
Flags: needinfo?(jkt)
I'm not sure if it is a good idea to measure the number of containers when a context menu opens but we shall see if there are any issues in try I guess.

I would actually prefer just to show a "No containers available" or even "Add a container" linking to the about:preferences in this case.
Flags: needinfo?(jkt)
Comment on attachment 8938889 [details]
Bug 1417238 - Hide container context menu when there are no items to display.

https://reviewboard.mozilla.org/r/209364/#review215170

::: browser/base/content/nsContextMenu.js:358
(Diff revision 1)
>      }
>  
>      var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink;
>      var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
> -    var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled");
> +    var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled")
> +                         && ContextualIdentityService.getPublicIdentities().length;

Here and in the test, please use trailing instead of leading operators (ie move `&&` to the end of the previous line), as this is convention in our codebase and also earlier in this method. We already go over 80ch per line within only a few lines of context, so I'm not so worried about that - though we might as well make the pref a lazy getter here...
Attachment #8938889 - Flags: review?(gijskruitbosch+bugs) → review+
Assignee: nobody → jkt
Status: REOPENED → ASSIGNED
Priority: -- → P1
I think this can be done as part of this work.

> Remove sub menu when there's only one container
> The links context menu "open in new container tab" is a droplist, but when there's only one entry it's pointless, we could save one click.

I also don't think the priority needs to be this high.
Priority: P1 → P3
Version: 57 Branch → 58 Branch
Version: 58 Branch → 60 Branch
Version: 60 Branch → 61 Branch
Version: 61 Branch → 62 Branch
Version: 62 Branch → 63 Branch
Version: 63 Branch → 64 Branch
Version: 64 Branch → 65 Branch
Version: 65 Branch → 66 Branch
Version: 66 Branch → 67 Branch
Version: 67 Branch → 68 Branch
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d14daa02fb88
hide 'open link in container' menu when there are no containers, r=jkt
Assignee: jkt → gijskruitbosch+bugs
Status: ASSIGNED → RESOLVED
Closed: 7 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70

I have reproduced this bug with Nightly 59.0a1 (2017-11-14) on Windows 10 , 64 Bit !

This bug's fix is Verified with latest Nightly 70.0a1 !

Build ID :--- 20190720095435
User Agent:--- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

Whiteboard: [testday-20190719]

Thank you Sajedul for helping with the verification of this issue!

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: