From d3d15acf3f8afb5f084c7c29917b3f8296631336 Mon Sep 17 00:00:00 2001 From: zhuzhengjun Date: Fri, 30 Aug 2024 17:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DinitialData=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?html=E5=86=85=E5=AE=B9=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuzhengjun --- .../plugin/webview/in_app_webview/InAppWebView.ets | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets index 40531790..39f964fe 100644 --- a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets +++ b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets @@ -884,7 +884,13 @@ export default class InAppWebView implements InAppWebViewInterface { async loadDataWithBaseURL(baseUrl: string, data: string, mimeType: string, encoding: string, historyUrl: string) { await this.waitControllerAttached(); - this.controller.loadData(data, mimeType, encoding, baseUrl, historyUrl) + if (baseUrl && historyUrl) { + this.controller.loadData(data, mimeType, encoding, baseUrl, historyUrl) + } else if (baseUrl) { + this.controller.loadData(data, mimeType, encoding, baseUrl) + } else { + this.controller.loadData(data, mimeType, encoding) + } } getController(): web_webview.WebviewController { -- Gitee