Skip to content

A window created by chrome.windows.create() doesn't match the web spec for window.menubar #907

@tophf

Description

@tophf

The web platform spec says that menubar.visible can be used by the script running in a window to tell the window is a popup and it is indeed so for popup windows created with window.open('', '_blank', 'popup=1'), but not so for chrome.windows.create({url: '...', type: 'popup'}).

Both Chrome and Firefox fail the test.

If the consensus will be not to fix it, the difference should be explicitly stated in the documentation.

The workarounds I see are:

  1. outside: when creating, add a dummy URL parameter/hash in create() and check location inside;
  2. inside: call an asynchronous (await browser.windows.getCurrent()).type which can't be used in a synchronous context like a beforeunload listener that conditionally prompts the user to save the changes. We can use it at the beginning of popup initialization of course but theoretically the user may try to close the popup before the call succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage: chromeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeneeds-triage: safariSafari needs to assess this issue for the first time

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions