Skip to content

[url_launcher] Document the need to launch from a user action handler on web #78524

@julien-fr

Description

@julien-fr

Hello,

I try to open an external url in a new tab with flutter web and url_launcher.

The code:
(await canLaunch(_url)) ? await launch(_url) : Get.snackbar("Error", 'Could not launch $_url');

When using this code, this doesn't work and there is no error message. However I guess it was normally the role of canLaunch().

In fact, I noticed the issue is related to popup. When I set the browser to allow popup a message is displayed asking to allow or block.
IMG_3591

As a majority of browsers have popups disabled by default how can I avoid this behavior? Is there a workaround?

At least can we detect popup are disabled by the browser?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listbrowser: safari-macosonly manifests in Safari on macOSd: api docsIssues with https://api.flutter.dev/found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions