Skip to content

Commit ae4471d

Browse files
Replaced Uri.encodeFull with Uri.encodeComponent to load html data correctly on Web platform
1 parent 0f20348 commit ae4471d

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.0.0-beta.17
2+
3+
- Replaced `Uri.encodeFull` with `Uri.encodeComponent` to load html data correctly on Web platform
4+
15
## 6.0.0-beta.16
26

37
- Removed Android Hybrid Composition constraint to use the pull-to-refresh feature

example/integration_test/in_app_webview/load_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void loadData() {
7171
if (!kIsWeb) {
7272
expect(currentUrl, TEST_CROSS_PLATFORM_URL_1.toString());
7373
} else {
74-
expect(currentUrl, 'data:$mimeType,' + Uri.encodeFull(data));
74+
expect(currentUrl, 'data:$mimeType,' + Uri.encodeComponent(data));
7575
}
7676

7777
pageLoads.close();

example/ios/Flutter/flutter_export_environment.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/3.3.6"
44
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6-
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
6+
export "FLUTTER_TARGET=lib/main.dart"
77
export "FLUTTER_BUILD_DIR=build"
88
export "FLUTTER_BUILD_NAME=1.0.0"
99
export "FLUTTER_BUILD_NUMBER=1"
10-
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
1110
export "DART_OBFUSCATION=false"
1211
export "TRACK_WIDGET_CREATION=true"
1312
export "TREE_SHAKE_ICONS=false"
14-
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
13+
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

lib/src/web/in_app_web_view_web_element.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class InAppWebViewWebElement implements Disposable {
280280
final String contentType =
281281
httpRequest.getResponseHeader('content-type') ?? 'text/html';
282282
return 'data:$contentType,' +
283-
Uri.encodeFull(httpRequest.responseText ?? '');
283+
Uri.encodeComponent(httpRequest.responseText ?? '');
284284
}
285285

286286
String getIFrameId() {
@@ -298,7 +298,7 @@ class InAppWebViewWebElement implements Disposable {
298298

299299
Future<void> loadData(
300300
{required String data, String mimeType = "text/html"}) async {
301-
iframe.src = 'data:$mimeType,' + Uri.encodeFull(data);
301+
iframe.src = 'data:$mimeType,' + Uri.encodeComponent(data);
302302
}
303303

304304
Future<void> loadFile({required String assetFilePath}) async {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_inappwebview
22
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
3-
version: 6.0.0-beta.16
3+
version: 6.0.0-beta.17
44
homepage: https://inappwebview.dev/
55
repository: https://github.com/pichillilorenzo/flutter_inappwebview
66
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues

0 commit comments

Comments
 (0)