Skip to content

Commit ecc1866

Browse files
committed
🐛 [kmp/helperPlatform] 添加一个16.4的版本比较,用于测试机器使用
1 parent 04e7c2f commit ecc1866

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

next/kmp/helperPlatform/src/iosMain/kotlin/org/dweb_browser/helper/platform/OffscreenWebCanvas.ios.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import platform.CoreGraphics.CGRectZero
1010
import platform.Foundation.NSURL.Companion.URLWithString
1111
import platform.Foundation.NSURLRequest.Companion.requestWithURL
1212
import platform.Foundation.setValue
13+
import platform.UIKit.UIDevice
1314
import platform.WebKit.WKWebView
1415
import platform.WebKit.WKWebViewConfiguration
1516
import platform.WebKit.javaScriptEnabled
@@ -26,8 +27,10 @@ actual class OffscreenWebCanvas private actual constructor(width: Int, height: I
2627
) : this(width, height) {
2728
config.preferences.javaScriptEnabled = true
2829
this.webview = WKWebView(frame = cValue { CGRectZero }, configuration = config).also {
29-
// if(UIDevice.currentDevice.systemVersion)
30-
it.setValue(value = true, forKey = "inspectable")
30+
if(UIDevice.currentDevice.systemVersion.compareTo("16.4", true) >= 0) {
31+
it.setValue(value = true, forKey = "inspectable")
32+
}
33+
3134
CoroutineScope(mainAsyncExceptionHandler).launch {
3235
it.loadRequest(requestWithURL(URLWithString(core.channel.getEntryUrl(width, height))!!))
3336
}

0 commit comments

Comments
 (0)