JS engine in WebView

Richard Bair richard.bair at oracle.com
Thu May 9 20:25:01 PDT 2013

Hi John,

On May 8, 2013, at 12:12 PM, John C. Turnbull <ozemale at ozemail.com.au> wrote:

> I know that WebView uses WebKit but what actual JavaScript engine does it use on Windows? I don't think WebKit forces you to use any particular engine.

Well…. it goes like this. WebKit comes with JavaScriptCore by default, and this is the JS engine that we use. It is pretty good. My understanding is that JavaScriptCore (aka SquirrelFish aka Nitro) is the same JS engine used by Safari[1]. When Chrome and Apple were both part of WebKit, one of the abstraction layers that Google had put into WebKit was the ability to swap out the JavaScript engine. When Google forked WebKit into Blink, the need for the WebKit project to have an abstraction for a different JS VM disappeared. As a consequence, the WebKit guys have been talking about removing those abstractions such that you won't be able to swap out the JS engine[2][3]. If/When that happens, it will be hard (or impossible) for us to switch over to Nashorn for WebView. We aren't going to fork WebKit, so we sort of have to follow along with what WebKit does.

> Will WebView eventually use Nashorn instead of what it's using currently!

Maybe, but maybe not for the reasons cited above. We will have to see how this whole Apple / Google divorce plays out.


[1] http://trac.webkit.org/wiki/JavaScriptCore

"Supporting V8 places a considerable burden on webkit, there are a number of 
large, cumbersome and expensive abstractions required for to support multiple
JS engines (see the original discussions on the topic from many years ago).

Additionally we will only be supporting JSC in WebKit2, so I don't think anything could
convince me at least that maintaining support for multiple JS engines is good for
the project." - Oliver Hunt

More information about the openjfx-dev mailing list