Created
October 13, 2019 19:04
-
-
Save mycroftcanner/93897d2da7bde4a0efcb3ab5f3e56581 to your computer and use it in GitHub Desktop.
webView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let userScript = WKUserScript(source: source, | |
injectionTime: .atDocumentEnd, | |
forMainFrameOnly: true) | |
let userContentController = WKUserContentController() | |
userContentController.addUserScript(userScript) | |
let configuration = WKWebViewConfiguration() | |
configuration.userContentController = userContentController | |
let webView = WKWebView(frame: .zero, | |
configuration: configuration) | |
webView.isOpaque = false | |
webView.backgroundColor = .clear | |
return webView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment