Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
webViewDidFinish
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
let css = "body { background-color : #ff0000 }"
let js = "var style = document.createElement('style'); style.innerHTML = '\(css)'; document.head.appendChild(style);"
webView.evaluateJavaScript(js, completionHandler: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.