Skip to content

[url_launcher] Add a web only windowName param #56867

@tugorez

Description

@tugorez

Use case

Browser APIs allow users to open urls in multiple ways:

  • same window
  • new window
  • new window with an specific name
  • an already existing window

Currently we don't provide mechanisms to specify those behaviors, instead we force users to open all urls always in a new tab.

Proposal

To give users control about how they believe an specific url should be opened, my proposal is to add a new windowName web-only param to the launch method.

Future<bool> launch(
  String urlString, {
  bool forceSafariVC,
  bool forceWebView,
  bool enableJavaScript,
  bool enableDomStorage,
  bool universalLinksOnly,
  String windowName,
  Map<String, String> headers,
  Brightness statusBarBrightness,
})

That will be used by the web implementation like this

  html.WindowBase openNewWindow(String url, String windowName = '') {
    return _window.open(url, windowName);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityp: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions