From 371edf56febe4bd13a0e1847ed5447ae71e29d60 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 19:44:27 +0200 Subject: [PATCH 01/14] [url_launcher] Adds documentation that a launch needs to be triggered by a user action --- packages/url_launcher/url_launcher/CHANGELOG.md | 4 ++++ .../url_launcher/lib/src/url_launcher_uri.dart | 10 ++++++++++ packages/url_launcher/url_launcher/pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index cebc8177291b..399d771667fe 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.15 + +* Adds documentation to the `launchUrl` method that a launch needs to be triggered by a user action. + ## 6.1.14 * Updates documentation to mention support for Android Custom Tabs. diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index b3ce6c279f39..5f5bd87aa85a 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -37,6 +37,16 @@ import 'type_conversion.dart'; /// - "_self" opens the new URL in the current tab. /// Default behaviour when unset is to open the url in a new tab. /// +/// Some web browsers, such as Safari, may prevent URL launching if it is not +/// triggered by a user action (e.g., a button click). Note that even if a user +/// triggers an action 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] argument, +/// setting it to "_self", to open the URL within the current tab. Another +/// approach is to ensure that the [uri] is synchronously ready. +/// /// Returns true if the URL was launched successful, otherwise either returns /// false or throws a [PlatformException] depending on the failure. Future launchUrl( diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 9feae723f2f1..4eceaa6dcfe8 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.1.14 +version: 6.1.15 environment: sdk: ">=3.0.0 <4.0.0" From f64dcc9ba84e9755a453827b9e9eaa82ca37be2e Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 19:48:08 +0200 Subject: [PATCH 02/14] Fix comment --- .../url_launcher/url_launcher/lib/src/url_launcher_uri.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index 5f5bd87aa85a..8c5a01d7dfb0 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -38,7 +38,7 @@ import 'type_conversion.dart'; /// Default behaviour when unset is to open the url in a new tab. /// /// Some web browsers, such as Safari, may prevent URL launching if it is not -/// triggered by a user action (e.g., a button click). Note that even if a user +/// triggered by a user action (e.g. a button click). Note that even if a user /// triggers an action 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 From ad9ddd95cbea69b24d4b3ad3a304e812f69fc661 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 19:49:00 +0200 Subject: [PATCH 03/14] Format comment --- .../url_launcher/lib/src/url_launcher_uri.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index 8c5a01d7dfb0..539b5d0ce08c 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -38,14 +38,14 @@ import 'type_conversion.dart'; /// Default behaviour when unset is to open the url in a new tab. /// /// Some web browsers, such as Safari, may prevent URL launching if it is not -/// triggered by a user action (e.g. a button click). Note that even if a user -/// triggers an action 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] argument, -/// setting it to "_self", to open the URL within the current tab. Another -/// approach is to ensure that the [uri] is synchronously ready. +/// triggered by a user action (e.g. a button click). Even if a user triggers an +/// action 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] argument, setting it to "_self", +/// to open the URL within the current tab. Another approach is to ensure that +/// the [uri] is synchronously ready. /// /// Returns true if the URL was launched successful, otherwise either returns /// false or throws a [PlatformException] depending on the failure. From bcbc28d409e042c81908d547b6dbb6d77e8d2b4d Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 19:49:58 +0200 Subject: [PATCH 04/14] Change action and launch --- .../url_launcher/url_launcher/lib/src/url_launcher_uri.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index 539b5d0ce08c..f39b45b04313 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -38,8 +38,8 @@ import 'type_conversion.dart'; /// Default behaviour when unset is to open the url in a new tab. /// /// Some web browsers, such as Safari, may prevent URL launching if it is not -/// triggered by a user action (e.g. a button click). Even if a user triggers an -/// action through a button click, if there is a delay due to awaiting a +/// 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 From 754fc27b340c0349a18000b153d81bdb978e9309 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 20:57:27 +0200 Subject: [PATCH 05/14] Add documentation to the README.md --- packages/url_launcher/url_launcher/CHANGELOG.md | 2 +- packages/url_launcher/url_launcher/README.md | 4 ++++ .../url_launcher/lib/src/url_launcher_uri.dart | 13 ++++--------- packages/url_launcher/url_launcher_web/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher_web/README.md | 10 ++++++++++ packages/url_launcher/url_launcher_web/pubspec.yaml | 2 +- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index 399d771667fe..b079031a971a 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,6 +1,6 @@ ## 6.1.15 -* Adds documentation to the `launchUrl` method that a launch needs to be triggered by a user action. +* Adds a link about web limitations to the `url_launcher_web` package in the `url_launcher` README and `launchUrl` method. ## 6.1.14 diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index afd60143a54b..15b386da0d8f 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -92,6 +92,10 @@ See [the Android documentation](https://developer.android.com/training/package-visibility/use-cases) for examples of other queries. +### Web + +Some web browsers may have limitations (e.g. a launch must be triggered a user action). Check [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) for more web-specific information. + ## Supported URL schemes The provided URL is passed directly to the host platform for handling. The diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index f39b45b04313..3ffa8c6dc7a0 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -37,15 +37,10 @@ import 'type_conversion.dart'; /// - "_self" opens the new URL in the current tab. /// Default behaviour when unset is to open the url in a new tab. /// -/// Some web browsers, such as Safari, may prevent URL launching if it is not -/// 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] argument, setting it to "_self", -/// to open the URL within the current tab. Another approach is to ensure that -/// the [uri] is synchronously ready. +/// Some web browsers, such as Safari, may prevent the launch if it is not +/// triggered by a user action (e.g. a button click). See +/// [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) +/// for more details. /// /// Returns true if the URL was launched successful, otherwise either returns /// false or throws a [PlatformException] depending on the failure. diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 4fd4abb5ec96..75b58ac40790 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.21 + +* Adds documentation that a launch needs to be triggered by a user action. + ## 2.0.20 * Migrates to `dart:ui_web` APIs. diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index bcea84855915..11af70338c6f 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -13,3 +13,13 @@ should add it to your `pubspec.yaml` as usual. [1]: https://pub.dev/packages/url_launcher [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin + +## Limitations on the Web platform + +### A launch needs to be triggered by a user action + +Some web browsers, such as Safari, may prevent URL launching if it is not 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. \ No newline at end of file diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index fce7da421b1b..d33f231454ae 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -2,7 +2,7 @@ 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.0.20 +version: 2.0.21 environment: sdk: ">=3.1.0 <4.0.0" From cbcb38d9a852bd36ca31a7be891fbe62b56608bd Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 21:00:58 +0200 Subject: [PATCH 06/14] Escape `README.md` in changelog --- packages/url_launcher/url_launcher/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index b079031a971a..3ecd6b5b187f 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,6 +1,6 @@ ## 6.1.15 -* Adds a link about web limitations to the `url_launcher_web` package in the `url_launcher` README and `launchUrl` method. +* Adds a link about web limitations to the `url_launcher_web` package in the `url_launcher` `README.md` and `launchUrl` method. ## 6.1.14 From d88d1f584912b9fd6a227de064546b59830bbd19 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 13 Oct 2023 21:01:22 +0200 Subject: [PATCH 07/14] Fix typo --- packages/url_launcher/url_launcher/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 15b386da0d8f..6871671ba656 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -94,7 +94,7 @@ for examples of other queries. ### Web -Some web browsers may have limitations (e.g. a launch must be triggered a user action). Check [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) for more web-specific information. +Some web browsers may have limitations (e.g. a launch must be triggered by a user action). Check [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) for more web-specific information. ## Supported URL schemes From 7dd42b9dd942a0d2801f1aa9a8c651f9464414d4 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 1 Dec 2023 09:18:46 +0100 Subject: [PATCH 08/14] Format README.md and remove paragraph --- packages/url_launcher/url_launcher/README.md | 5 ++++- packages/url_launcher/url_launcher_web/README.md | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 6871671ba656..551257cee68c 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -94,7 +94,10 @@ for examples of other queries. ### Web -Some web browsers may have limitations (e.g. a launch must be triggered by a user action). Check [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) for more web-specific information. +Some web browsers may have limitations (e.g. a launch must be triggered by a +user action). Check +[package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) +for more web-specific information. ## Supported URL schemes diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index 11af70338c6f..ad55b1f40b00 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -18,8 +18,13 @@ should add it to your `pubspec.yaml` as usual. ### A launch needs to be triggered by a user action -Some web browsers, such as Safari, may prevent URL launching if it is not 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. \ No newline at end of file +Some web browsers, such as Safari, may prevent URL launching if it is not +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. \ No newline at end of file From db2052594c12bfc478d422549d41c501c3c7aa63 Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Fri, 8 Dec 2023 08:30:43 +0100 Subject: [PATCH 09/14] Update packages/url_launcher/url_launcher_web/CHANGELOG.md Co-authored-by: David Iglesias --- packages/url_launcher/url_launcher_web/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 3b0ad64e2a2c..7ec4082035a1 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.2.2 -* Adds documentation that a launch needs to be triggered by a user action. +* Adds documentation that a launch in a new window/tab needs to be triggered by a user action. ## 2.2.1 From 043816d6377e72c69d4c0ffd04e7a501665bbaa5 Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Fri, 8 Dec 2023 08:31:07 +0100 Subject: [PATCH 10/14] Update packages/url_launcher/url_launcher_web/README.md Co-authored-by: David Iglesias --- packages/url_launcher/url_launcher_web/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index ad55b1f40b00..963c97718a8b 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -27,4 +27,6 @@ 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. \ No newline at end of file +`uri` is synchronously ready. + +Read more: MDN > [Transient activation](https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation). \ No newline at end of file From 5234fb89a5f509ce7cd8608b9af02805c80d234d Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Fri, 8 Dec 2023 08:31:17 +0100 Subject: [PATCH 11/14] Update packages/url_launcher/url_launcher_web/README.md Co-authored-by: David Iglesias --- packages/url_launcher/url_launcher_web/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index 963c97718a8b..c8ff6cb8db13 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -18,8 +18,8 @@ should add it to your `pubspec.yaml` as usual. ### A launch needs to be triggered by a user action -Some web browsers, such as Safari, may prevent URL launching if it is not -triggered by a user action (e.g. a button click). +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 From 3a03cffbf3252e6cc859b4e3ed57263d0a6f6fde Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Fri, 8 Dec 2023 08:31:23 +0100 Subject: [PATCH 12/14] Update packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart Co-authored-by: David Iglesias --- .../url_launcher/url_launcher/lib/src/url_launcher_uri.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index dfba5f09c292..d91558a673a8 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -29,7 +29,7 @@ import 'type_conversion.dart'; /// - "_self" opens the new URL in the current tab. /// Default behaviour when unset is to open the url in a new tab. /// -/// Some web browsers, such as Safari, may prevent the launch if it is not +/// Web browsers prevent launching URLs in a new tab/window, unless /// triggered by a user action (e.g. a button click). See /// [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) /// for more details. From a76f52abd5e0fb7bff7719415241f4ba52146346 Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Fri, 8 Dec 2023 08:31:30 +0100 Subject: [PATCH 13/14] Update packages/url_launcher/url_launcher_web/README.md Co-authored-by: David Iglesias --- packages/url_launcher/url_launcher_web/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index c8ff6cb8db13..670870e693fd 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -24,9 +24,10 @@ 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 +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](https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation). \ No newline at end of file From 8d140e56ce7939cf413a0762131e3ec26e5d9d07 Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Fri, 8 Dec 2023 08:34:51 +0100 Subject: [PATCH 14/14] Format Markdown file --- packages/url_launcher/url_launcher_web/CHANGELOG.md | 3 ++- packages/url_launcher/url_launcher_web/README.md | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 7ec4082035a1..ed6042312a10 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.2.2 -* Adds documentation that a launch in a new window/tab needs to be triggered by a user action. +* Adds documentation that a launch in a new window/tab needs to be triggered by + a user action. ## 2.2.1 diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index 670870e693fd..f186d7a49bb8 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -18,16 +18,16 @@ should add it to your `pubspec.yaml` as usual. ### 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). +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. +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](https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation). \ No newline at end of file