Skip to content

Instantly share code, notes, and snippets.

@Ceri-anne
Last active November 25, 2017 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Ceri-anne/c3163d98822b6bc4c3edb16943c684c1 to your computer and use it in GitHub Desktop.
Save Ceri-anne/c3163d98822b6bc4c3edb16943c684c1 to your computer and use it in GitHub Desktop.
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