Closed Bug 1289832 Opened 5 years ago Closed 5 years ago

"Open Link in New *Current Container*" missing from context menu when opening about:newtab thumbnails

Categories

(Firefox :: Menus, defect, P2)

50 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 52
Tracking Status
firefox50 --- affected
firefox52 --- verified

People

(Reporter: kjozwiak, Assigned: baku)

References

(Blocks 1 open bug)

Details

(Whiteboard: [userContextId][domsecurity-backlog])

Attachments

(2 files, 1 obsolete file)

Attached image issue.png
"Open Link in New *Current Container*" is missing from the context menu when right clicking on thumbnails under about:newtab while using containers. This was implemented via bug#1276880 and should be a consistent UX throughout fx. Probably a P3 or higher as it's not a major/critical issue.

STR:

* launch the latest version of m-c
* open a new container tab via File -> New Container Tab
* right click on any of the thumbnails under the about:newtab page

You'll notice that the "Open Link in New *Current Container*" is missing from the context menu.
Priority: -- → P3
Increasing priority to P2 since this could lead users to accidentally using the wrong Container.
Priority: P3 → P2
The reason why this happens is because about:newtab runs with systemPrincipal, so with userContextId == 0.
Probably we should have a special about:newtab for containers.
So we have to either
* Get the OriginAttributes from the LoadInfo instead of the principal (assuming Context Menu has access to LoadInfo)
OR
* Check the parent windows usercontextid.
Attached patch container.patch (obsolete) — Splinter Review
Assignee: nobody → amarchesini
Attachment #8793708 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8793708 [details] [diff] [review]
container.patch

Review of attachment 8793708 [details] [diff] [review]:
-----------------------------------------------------------------

This won't work in e10s, no? contentDocument is going to be null.

Feels like we should be selecting the right userContextId and put it in the gContextMenuData in whatever code does that, where we are guaranteed to always have access to the document and its load channel even if it's remote.
Attachment #8793708 - Flags: review?(gijskruitbosch+bugs) → review-
Attached patch container.patchSplinter Review
Attachment #8793708 - Attachment is obsolete: true
Attachment #8793724 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8793724 [details] [diff] [review]
container.patch

Review of attachment 8793724 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8793724 - Flags: review?(gijskruitbosch+bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb8ffc4a9c99
ContextMenu should take userContextId from nsILoadContext, r=gijs
https://hg.mozilla.org/mozilla-central/rev/fb8ffc4a9c99
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Went through verification using the following build:
* https://archive.mozilla.org/pub/firefox/nightly/2016/09/2016-09-27-03-02-00-mozilla-central/

Platforms Used:

* OSX 10.11.6 x64 - PASSED
* Win 10 x64 VM - PASSED
* Ubuntu 16.04.1 LTS x64 VM - PASSED

Test Cases Used:

* ensured that "Open Link in New [Current Container]" appeared under the right click context menu when opening containers via
** "file -> new container tab"
** "hamburger menu -> open container tab"
** [OSX only] "file -> new container tab" while all the windows are closed
** "arrow down -> new container tab" when there's many tabs opened
* checked and ensured that cookies were being placed in the correct container when using "Open Link in New [Current Container]" in the appropriate container
* ensured that the current container doesn't appear under the "Open Link in New Container Tab" context menu
* ensured that removing and restoring tiles from about:newtab is working without any issues
* ensured that using "Show blank page" didn't cause any issues under about:newtabs
* ensured that "Open Link in New Container Tab" didn't appear under the right click context menu under PB & "Never Save History" under about:preferences#privacy
* ensured that "Open Link in New [Current Container]" didn't appear under right click context menu under PB & "Never Save History" under about:preferences#privacy
* ensured that "Open Link in New [Current Container]" didn't appear under right click context menu under the default container
* ensured that "Open Link in New Container Tab" had all four container entries under the right click context menu when using the default container
Please stop putting front-end bugs in Core :: DOM: Security. Thank you.
Component: DOM: Security → Menus
Product: Core → Firefox
Target Milestone: mozilla52 → ---
Target Milestone: --- → Firefox 52
You need to log in before you can comment on or make changes to this bug.