tabs.open fails if no window is open

RESOLVED INCOMPLETE

Status

Add-on SDK
General
P2
normal
RESOLVED INCOMPLETE
3 years ago
4 months ago

People

(Reporter: Jamie Phelps, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Created attachment 8566693 [details]
open-new-tab.zip

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18

Steps to reproduce:

As I realized while chatting in IRC #jetpack today, this probably only affects Mac because other platforms don't have a concept of keeping an app running after the last window is closed.

1Password supports opening URLs for filling from the main app and the helper app. Depending on the state of the browser (whether it has focus, whether there is a window, whether the frontmost tab has a URL) and the user's settings (open in a new tab, current tab, or new window) 1Password needs to reason about the environment and respond appropriately.

We can identify when we think a tab does not actually exist (See Bug #1134699 for why we can't be 100% certain…) and attempt to open a tab. But, tabs.open fails when there is no window.

Run the attached example add-on. The first time, let the new window stay open. The second time, close the new window as soon as it opens before the timer fires.


Actual results:

When a window is present, the tab is properly opened. When a window is not open, the tab is not opened.


Expected results:

The tab should always open when tabs.open is called.
Blocks: 821779
Priority: -- → P2
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.