on master help sign in
Update README.md
commit86dd3d7a34593b1bf2ebf5d1ca359e921f5281c8 authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com> dateMon 3 Oct 2016, 01:48 (10 years ago) parent14c8c28
1 file changed+5−4
README.md+5−4
README.md+5−4
@@ -71,7 +71,7 @@ import qualified GHCJS.DOM.Element as E (click)
7171main = run 3708 $ do
7272 Just doc <- currentDocument
7373 Just body <- getBody doc
74− setInnerHTML body (Just "<h1>Hello World</h1>")
74+ setInnerHTML body (Just "<h1>Kia ora (Hi)</h1>")
7575 on doc D.click $ do
7676 (x, y) <- mouseClientXY
7777 Just newParagraph <- createElement doc (Just "p")
@@ -103,11 +103,12 @@ When compiled with GHC this code will run a Warp web server you can connect to a
103103## How does it work on GHC
104104
105105As of version 0.5 it runs a small warp server that provides [index.html](https://github.com/ghcjs/jsaddle/blob/master/data/index.html) and
106−[jsaddle.js](https://github.com/ghcjs/jsaddle/blob/master/data/jsaddle.js). The [jsaddle.js](https://github.com/ghcjs/jsaddle/blob/master/data/jsaddle.js) code connects to the server using WebSockets and processes JSON requests from the server and sends the result back over the same WebSocket.
106+[jsaddle.js](https://github.com/ghcjs/jsaddle/blob/master/data/jsaddle.js). The [jsaddle.js](https://github.com/ghcjs/jsaddle/blob/master/data/jsaddle.js) code connects to the server using WebSockets and processes JSON commands from the server and sends the result back over the same WebSocket.
107107
108108### Why use WebSockets?
109−Older versions relied on WebKitGTK and JavaScriptCore, but with WekKit2 the interface used was only available to WebKit Extensions
110−so most of the benefits of this interface were lost (it was no longer in process with the Gtk code and RPC would have been needed).
109+
110+Older versions relied on WebKitGTK and JavaScriptCore, but in WekKit2 the interface JSaddle used is only available to WebKit Extensions
111+so most of the benefits of this interface are lost (extensions are not in the same process as Gtk and RPC would have been needed).
111112The general advice for people migrating from WebKit1 to WebKit2 seems to be to use JavaScript. There is an interface in WebKit2
112113to send JavaScript code from the host application, but it does not seem to provide any advantages over the WebSockets approach.
113114