From ecc1866d884b43da12ea109d574bf87c6f968a05 Mon Sep 17 00:00:00 2001 From: kingsword09 Date: Wed, 1 Nov 2023 09:58:07 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20[kmp/helperPlatform]=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA16.4=E7=9A=84=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=AF=94=E8=BE=83=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/next/kmp/helperPlatform/src/iosMain/kotlin/org/dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt b/next/kmp/helperPlatform/src/iosMain/kotlin/org/dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt index 292484837b..01b28b644f 100644 --- a/next/kmp/helperPlatform/src/iosMain/kotlin/org/dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt +++ b/next/kmp/helperPlatform/src/iosMain/kotlin/org/dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt @@ -10,6 +10,7 @@ import platform.CoreGraphics.CGRectZero import platform.Foundation.NSURL.Companion.URLWithString import platform.Foundation.NSURLRequest.Companion.requestWithURL import platform.Foundation.setValue +import platform.UIKit.UIDevice import platform.WebKit.WKWebView import platform.WebKit.WKWebViewConfiguration import platform.WebKit.javaScriptEnabled @@ -26,8 +27,10 @@ actual class OffscreenWebCanvas private actual constructor(width: Int, height: I ) : this(width, height) { config.preferences.javaScriptEnabled = true this.webview = WKWebView(frame = cValue { CGRectZero }, configuration = config).also { -// if(UIDevice.currentDevice.systemVersion) - it.setValue(value = true, forKey = "inspectable") + if(UIDevice.currentDevice.systemVersion.compareTo("16.4", true) >= 0) { + it.setValue(value = true, forKey = "inspectable") + } + CoroutineScope(mainAsyncExceptionHandler).launch { it.loadRequest(requestWithURL(URLWithString(core.channel.getEntryUrl(width, height))!!)) }