Open Bug 1421709 Opened 8 years ago Updated 4 months ago

Investigate other possible uses for WindowTracker.topNormalWindow on desktop

Categories

(WebExtensions :: Frontend, enhancement, P5)

58 Branch
x86_64
Linux
enhancement

Tracking

(Not tracked)

People

(Reporter: bsilverberg, Unassigned)

References

(Blocks 1 open bug)

Details

Bug 1415913 introduced a topNormalWindow property to WindowTracker on desktop, which returns the topmost window that is not a popup. This was used to enhance tabs.create when no windowId is passed, but there may be other places where we are currently using topWindow that could benefit from being changed to topNormalWindow. This bug is to identify those cases and replace topWindow with topNormalWindow.
Product: Toolkit → WebExtensions
Severity: normal → S3

Bug 1415913 ensures that new tabs are not unknowingly created in windows of type "popup". I think that we should extend this restriction to be more strict, and even disallow new tabs in windows of type "popup". Bug 1960944 is an example of a bug that happens when a popup unexpectedly gets a new tab. It looks like we are turning a popup window in a light version of a tabbed browser.

Internally, a window of type "popup" becomes a dialog. When I tested on Linux, the window is on top of all browser windows.

If we want to disallow adopting tabs in such windows, we should add a check to all extension APIs that may put a tab in an arbitrary window:

  • tabs.create()
  • tabs.duplicate()
  • tabs.group()
  • tabs.move()
  • tabGroups.move() - being added in bug 1961660
  • windows.create() - maybe? this can adopt an existing tab when passed tabId.

Additionally, we should audit for uses of windowTracker.topWindow internally (as reported in this bug) and check if we make sure that the implementations don't spawn a tab in the given window.

See Also: → 1960944
You need to log in before you can comment on or make changes to this bug.