Skip to content

Instantly share code, notes, and snippets.

@mycroftcanner
Created October 13, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mycroftcanner/a272cdbb97182063e66a8f86d24ebde9 to your computer and use it in GitHub Desktop.
Save mycroftcanner/a272cdbb97182063e66a8f86d24ebde9 to your computer and use it in GitHub Desktop.
return configure(WKWebView(
frame: .zero,
configuration: configure(WKWebViewConfiguration()) {
$0.userContentController = configure(WKUserContentController()) {
$0.addUserScript(
WKUserScript(
source: source,
injectionTime: .atDocumentEnd,
forMainFrameOnly: true
)
)
}
}
)
){
$0.isOpaque = false
$0.backgroundColor = .clear
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment