Open in New Tab with window.openUILink does not preserve tab container

UNCONFIRMED
Unassigned

Status

()

Core
XPCOM
P3
normal
UNCONFIRMED
2 years ago
9 months ago

People

(Reporter: webstrand, Unassigned)

Tracking

53 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161231030203

Steps to reproduce:

Open a tab inside of a container tab. Inside the Developer Tool's Network tab, select a request and in the request's context menu "Open in New Tab".


Actual results:

The newly opened tab was opened in the default container.


Expected results:

The newly opened tab should've been opened inside of the same container as the original tab.
(Reporter)

Comment 1

2 years ago
The User Agent was spoofed, it is correctly: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

Updated

2 years ago
Component: Untriaged → Developer Tools: Netmonitor

Updated

2 years ago
OS: Unspecified → All
Hardware: Unspecified → All
Version: Trunk → 53 Branch
Priority: -- → P3
We use window.openUILinkIn to open new tab in netmonitor now.

Andrea, do you have any suggest way to open new tab in same container?
Flags: needinfo?(amarchesini)
You can use gBrowser.addTab('...', { userContextId: the_user_context_id });

the userContextId can be taken from:

1. if you are in the parent process and you have access to the tab element (XULElement), just do: parseInt(tab.getAttribute('usercontextid'), 10);

2. if you are in the content process, you can take userContextId from the principal: document.nodePrincipal.originAttributes.userContextId - but only if the principal is not systemprincipal (otherwise you will have always userContextId = 0).
Flags: needinfo?(amarchesini)
Thanks Andrea for clarification. 

Since we use the `window.openUILinkIn` from `Services`, we'll get benefit from the API fix from XPCOM.

Change the title and category accordingly
Component: Developer Tools: Netmonitor → XPCOM
Priority: P3 → --
Product: Firefox → Core
Summary: Open in New Tab for a request in the Developer Tool's Network tab does not preserve tab container → Open in New Tab with window.openUILink does not preserve tab container
(In reply to Fred Lin [:gasolin] from comment #4)
> Thanks Andrea for clarification. 
> 
> Since we use the `window.openUILinkIn` from `Services`, we'll get benefit
> from the API fix from XPCOM.
> 
> Change the title and category accordingly

It's not really clear to me how the fix would be at the XPCOM level...
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.