Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.9.1

* Fixes bug where `WebkitWebViewController.getUserAgent` was incorrectly returning an empty String.

## 3.9.0

* Adds support for `PlatformWebViewController.getUserAgent`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ Future<void> main() async {

final String? userAgent = await controller.getUserAgent();
expect(userAgent, isNotNull);
expect(userAgent, isNotEmpty);
});

group('Video playback policy', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ window.addEventListener("error", function(e) {
@override
Future<String?> getUserAgent() async {
final String? customUserAgent = await _webView.getCustomUserAgent();
if (customUserAgent != null) {
// Despite the official documentation of `WKWebView.customUserAgent`, the
// default value seems to be an empty String and not null. It's possible it
// could depend on the iOS version, so this checks for both.
if (customUserAgent != null && customUserAgent.isNotEmpty) {
return customUserAgent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 3.9.0
version: 3.9.1

environment:
sdk: ">=2.19.0 <4.0.0"
Expand Down