Skip to content

[Feature Request]: Add {options, disposition, additionalFeatures, referrer, postData} to setWindowOpenHandler #28380

@Prinzhorn

Description

@Prinzhorn

Preflight Checklist

Problem Description

This supersedes #28377. setWindowOpenHandler is missing all the fancy arguments that new-window had. And did-create-window is too late because you need the arguments to decide what to do.

Some examples:

  1. I only want disposition === 'new-window' and deny all others
  2. In case of disposition === '*-tab' I want to deny and instead create a BrowserView for my custom tab implementation
  3. I want to handle postBody without creating a new window

You get the gist.

Proposed Solution

If setWindowOpenHandler is supposed to replace new-window it needs to offer the same flexibility

Alternatives Considered

Use did-create-window and undo the window if needed. But that defeats the original purpose

new-window is fired after the contents is already created by Chrome. This is a problem when the application wants to prevent that window from being opened, as killing the window during initialization causes many problems and leads to the inevitable crash.

Additional Information

n/a

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions