Viewing version 2.4.3. Open the latest package page.

url_launcher_web

2.4.3

Web platform implementation of url_launcher

Download archive

Readme

url_launcher_web

The web implementation of url_launcher.

Usage

This package is endorsed, which means you can simply use url_launcher normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Limitations on the Web platform

A launch needs to be triggered by a user action

Web browsers prevent launching URLs in a new tab/window, unless triggered by a user action (e.g. a button click).

Even if a user triggers a launch through a button click, if there is a delay due to awaiting a Future before the launch, the browser may still block it. This is because the browser might perceive the launch as not being a direct result of user interaction, particularly if the Future takes too long to complete.

In such cases, you can use the webOnlyWindowName parameter, setting it to _self, to open the URL within the current tab. Another approach is to ensure that the uri is synchronously ready.

Read more: MDN > Transient activation.

Method launchUrl always returns true for allowed schemes

The launchUrl method always returns true on the web platform for allowed schemes. This is because URLs are opened in a new window using the noopener window feature. When the noopener feature is used, the browser does not return any information that can be used to determine if the link was successfully opened.

Read more: MDN > window.open.

Changelog

2.4.3

  • Removes a LICENSE entry for code that no longer exists in the package.

2.4.2

  • Fixes an issue that caused duplicate semantic nodes for Link widgets.
  • Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.

2.4.1

  • Fixes a bug that triggers Links when they are not supposed to.

2.4.0

  • Enhances handling of out-of-order events.
  • Adds support for clicks with a modifier key (e.g. cmd+click).
  • Improves support for semantics.
  • Applies the target attribute to semantic links.
  • Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

2.3.3

  • Changes launchUrl so it always returns true, except for disallowed URL schemes.

2.3.2

  • Adds support for web: ^1.0.0.

2.3.1

  • Implements correct handling of keyboard events with Link.

2.3.0

  • Updates web code to package web: ^0.5.0.
  • Updates SDK version to Dart ^3.3.0. Flutter ^3.19.0.

2.2.3

  • Fixes new lint warnings.

2.2.2

  • Adds documentation that a launch in a new window/tab needs to be triggered by a user action.

2.2.1

  • Supports Flutter Web + Wasm
  • Updates minimum supported SDK version to Flutter 3.16.0/Dart 3.2.0.

2.2.0

  • Implements supportsMode and supportsCloseForMode.

2.1.0

  • Adds launchUrl implementation.
  • Prevents Tabnabbing and disallows javascript: URLs on launch and launchUrl.

2.0.20

  • Migrates to dart:ui_web APIs.
  • Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.

2.0.19

  • Adds pub topics to package metadata.
  • Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.

2.0.18

  • Removes nested third_party Safari check.

2.0.17

  • Removes obsolete null checks on non-nullable values.
  • Updates minimum Flutter version to 3.3.

2.0.16

  • Clarifies explanation of endorsement in README.
  • Aligns Dart and Flutter SDK constraints.

2.0.15

  • Updates links for the merge of flutter/plugins into flutter/packages.
  • Updates minimum Flutter version to 3.0.

2.0.14

  • Updates code for stricter lint checks.
  • Updates minimum Flutter version to 2.10.

2.0.13

  • Updates url_launcher_platform_interface constraint to the correct minimum version.

2.0.12

  • Fixes call to setState after dispose on the Link widget. Issue.
  • Removes unused BuildContext from the LinkViewController.

2.0.11

  • Minor fixes for new analysis options.

2.0.10

  • Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors lint warnings.

2.0.9

  • Fixes invalid routes when opening a Link in a new tab

2.0.8

  • Updates the minimum Flutter version to 2.10, which is required by the change in 2.0.7.

2.0.7

  • Marks the Link widget as invisible so it can be optimized by the engine.

2.0.6

  • Removes dependency on meta.

2.0.5

  • Updates code for new analysis options.

2.0.4

  • Add implements to pubspec.

2.0.3

  • Replaced reference to shared_preferences plugin with the url_launcher in the README.

2.0.2

  • Updated installation instructions in README.

2.0.1

  • Change sizing code of Link widget's HtmlElementView so it works well when slotted.

2.0.0

  • Migrate to null safety.

0.1.5+3

  • Fix Link misalignment issue.

0.1.5+2

  • Update Flutter SDK constraint.

0.1.5+1

  • Substitute undefined_prefixed_name: ignore analyzer setting by a dart:ui shim with conditional exports. Issue.

0.1.5

  • Added the web implementation of the Link widget.

0.1.4+2

  • Move lib/third_party to lib/src/third_party.

0.1.4+1

  • Add a more correct attribution to package:platform_detect code.

0.1.4

  • (Null safety) Remove dependency on package:platform_detect
  • Port unit tests to run with flutter drive

0.1.3+2

  • Fix a typo in a test name and fix some style inconsistencies.

0.1.3+1

  • Depend explicitly on the platform_interface package that adds the webOnlyWindowName parameter.

0.1.3

  • Added webOnlyWindowName parameter to launch()

0.1.2+1

  • Update docs

0.1.2

  • Adds "tel" and "sms" support

0.1.1+6

  • Open "mailto" urls with target set as "_top" on Safari browsers.
  • Update lower bound of dart dependency to 2.2.0.

0.1.1+5

  • Update lower bound of dart dependency to 2.1.0.

0.1.1+4

0.1.1+3

  • Refactor tests to not rely on the underlying browser behavior.

0.1.1+2

  • Open urls with target "_top" on iOS PWAs.

0.1.1+1

  • Make the pedantic dev_dependency explicit.

0.1.1

  • Added support for mailto scheme

0.1.0+2

  • Remove androidx references from the no-op android implemenation.

0.1.0+1

0.1.0

  • Update docs and pubspec.

0.0.2

  • Switch to using url_launcher_platform_interface.

0.0.1

  • Initial open-source release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'url_launcher_web:2.4.3'
pubspec.yaml
name: url_launcher_web
description: Web platform implementation of url_launcher
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 2.4.3

environment:
  sdk: ^3.10.0
  flutter: ">=3.38.0"

flutter:
  plugin:
    implements: url_launcher
    platforms:
      web:
        pluginClass: UrlLauncherPlugin
        fileName: url_launcher_web.dart

dependencies:
  flutter:
    sdk: flutter
  flutter_web_plugins:
    sdk: flutter
  url_launcher_platform_interface: ^2.2.0
  web: ">=0.5.1 <2.0.0"

dev_dependencies:
  flutter_test:
    sdk: flutter

topics:
  - links
  - os-integration
  - url-launcher
  - urls

Version history

VersionPublishedArchiveSHA-256
0.0.2On demandDownload7eee7977…4e742d
0.1.0On demandDownload0dfae9eb…b67771
0.1.0+1On demandDownload307f073d…c4f6f3
0.1.0+2On demandDownloaddb91714d…5f6210
0.1.1On demandDownloadea247540…04996f
0.1.1+1On demandDownload5d42ce19…f30513
0.1.1+2On demandDownloade6c3d26a…51bb69
0.1.1+4On demandDownload254131d3…e974ed
0.1.1+5On demandDownload910b391e…7c54ff
0.1.1+6On demandDownload723a89a1…bda79e
0.1.2On demandDownload09a6f9e1…e7eeef
0.1.2+1On demandDownloada63c10b2…6176d6
0.1.3On demandDownloadb7478fa6…559043
0.1.3+1On demandDownloada591a219…6c1be7
0.1.3+2On demandDownload8d7b48ca…73016d
0.1.4+1On demandDownload1a6f8a03…782857
0.1.5On demandDownload36f97f5a…8ced2c
0.1.5+1On demandDownload8672efbe…76b299
0.1.5+3On demandDownloadeaa6de8a…83dbc2
2.0.0-nullsafetyOn demandDownload25e457dc…5cea0a
2.0.0On demandDownload057e3458…c0f657
2.0.1On demandDownloadc664a85a…192754
2.0.2On demandDownload98f7b59f…fe32bd
2.0.4On demandDownloada2bc64b5…0d323e
2.0.5On demandDownload53be6a00…81862a
2.0.6On demandDownload88de707c…085850
2.0.7On demandDownloadd486afa4…3e7326
2.0.8On demandDownload6699ef5a…493964
2.0.9On demandDownload2b549472…28d97f
2.0.10On demandDownload141c1035…3b9dc9
2.0.11On demandDownload1c7d34f9…6e9abe
2.0.12On demandDownload15fd9dbb…800deb
2.0.13On demandDownload56698826…07df2a
2.0.14On demandDownload44d79408…19ccb0
2.0.15On demandDownload574cfbe2…69dd9b
2.0.16On demandDownload81fe91b6…28f1aa
2.0.17On demandDownload6bb1e5d7…5cfcab
2.0.18On demandDownloadcc26720e…a5cbb4
2.0.19On demandDownloadba140138…cd94f2
2.0.20On demandDownload2942294a…020ce5
2.1.0On demandDownload043a0d5b…f56d17
2.2.0On demandDownload7fd2f55f…718bb2
2.2.1On demandDownload138bd45b…851cf7
2.2.2On demandDownload7286aec0…a358e9
2.2.3On demandDownloadfff09321…a5e88b
2.3.0On demandDownload3692a459…1a901d
2.3.1On demandDownload8d9e750d…e95d8a
2.3.2On demandDownloada36e2d79…98d049
2.3.3On demandDownload772638d3…3dca8e
2.4.0On demandDownload3ba96316…85f1e9
2.4.1On demandDownload4bd2b7b4…3abba2
2.4.2On demandDownloadd0412fcf…476c1f
2.4.3Cached · Upstream SHA-256 matchedDownload85c81589…9ddb34

Dependencies

flutter { "sdk": "flutter" }

flutter_web_plugins { "sdk": "flutter" }

url_launcher_platform_interface "^2.2.0"

web "\u003e=0.5.1 \u003c2.0.0"