Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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