WKWebView

Loading local file, assets and css and calling javascript.

Local files and assets load correctly if baseUrl is set.

A ScriptMessageHandler "MyObserver" is added when the WKWebView is configured at start up. The "Call.." button calls the javascript function changeText() in this html file, cahnging the text below.

The "Show a Swift alert" link calls showSwiftDialog() which calls the WKScriptMessageHandler delegate method userContentController and brings up a dialog with the passed message text.

[Swift]:

Show a Swift alert from Javascript

Another page