Merge pull request #6985 from AlphaWallet/make-wkwebview-used-for-tokenscript-views-inspectable

Make WKWebView used for TokenScript views inspectable
pull/6987/head
Hwee-Boon Yar 1 year ago committed by GitHub
commit 06b5721f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      AlphaWallet/Tokens/Views/TokenInstanceWebView.swift

@ -33,7 +33,11 @@ class TokenInstanceWebView: UIView, TokenScriptLocalRefsSource {
lazy private var webView: WKWebView = {
let webViewConfig = WKWebViewConfiguration.make(forType: .tokenScriptRenderer, address: wallet.address, messageHandler: ScriptMessageProxy(delegate: self))
webViewConfig.websiteDataStore = .default()
return .init(frame: .init(x: 0, y: 0, width: 40, height: 40), configuration: webViewConfig)
let webView = WKWebView(frame: .init(x: 0, y: 0, width: 40, height: 40), configuration: webViewConfig)
if #available(iOS 16.4, *) {
webView.isInspectable = true
}
return webView
}()
private var lastInjectedJavaScript: String?
//TODO remove once we refactor internals to include a TokenScriptContext

Loading…
Cancel
Save