File tree 4 files changed +33
-3
lines changed
packages/webview_flutter/webview_flutter_wkwebview
4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change
1
+ ## 3.9.2
2
+
3
+ * Fixes error caused by calling ` WKWebViewConfiguration.limitsNavigationsToAppBoundDomains ` on
4
+ versions below 14.
5
+
1
6
## 3.9.1
2
7
3
8
* Fixes bug where ` WebkitWebViewController.getUserAgent ` was incorrectly returning an empty String.
Original file line number Diff line number Diff line change @@ -70,8 +70,14 @@ class WebKitWebViewControllerCreationParams
70
70
);
71
71
}
72
72
_configuration.setAllowsInlineMediaPlayback (allowsInlineMediaPlayback);
73
- _configuration.setLimitsNavigationsToAppBoundDomains (
74
- limitsNavigationsToAppBoundDomains);
73
+ // `WKWebViewConfiguration.limitsNavigationsToAppBoundDomains` is only
74
+ // supported on iOS versions 14+. So this only calls it if the value is set
75
+ // to true.
76
+ if (limitsNavigationsToAppBoundDomains) {
77
+ _configuration.setLimitsNavigationsToAppBoundDomains (
78
+ limitsNavigationsToAppBoundDomains,
79
+ );
80
+ }
75
81
}
76
82
77
83
/// Constructs a [WebKitWebViewControllerCreationParams] using a
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
2
2
description : A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
5
- version : 3.9.1
5
+ version : 3.9.2
6
6
7
7
environment :
8
8
sdk : " >=2.19.0 <4.0.0"
Original file line number Diff line number Diff line change @@ -160,6 +160,25 @@ void main() {
160
160
);
161
161
});
162
162
163
+ test (
164
+ 'limitsNavigationsToAppBoundDomains is not called if it uses default value (false)' ,
165
+ () {
166
+ final MockWKWebViewConfiguration mockConfiguration =
167
+ MockWKWebViewConfiguration ();
168
+
169
+ WebKitWebViewControllerCreationParams (
170
+ webKitProxy: WebKitProxy (
171
+ createWebViewConfiguration: ({InstanceManager ? instanceManager}) {
172
+ return mockConfiguration;
173
+ },
174
+ ),
175
+ );
176
+
177
+ verifyNever (
178
+ mockConfiguration.setLimitsNavigationsToAppBoundDomains (any),
179
+ );
180
+ });
181
+
163
182
test ('mediaTypesRequiringUserAction' , () {
164
183
final MockWKWebViewConfiguration mockConfiguration =
165
184
MockWKWebViewConfiguration ();
You can’t perform that action at this time.
0 commit comments