What js 'engine' does cordova use?

2020-07-15 15:28发布

问题:

What JS 'engine' does Cordova use? Is it platform specific or is it one standard across all platforms? Meaning safari for iOS and chrome for Android, and possible IE standards for windows? Or a 'Cordova JS' engine across all platforms.

More specifically i read that it depends on the browser JS implementation for what sorting algorithm .sort() uses (Mozilla uses merge-sort). And i was considering using a merge-sort function i created or the standard .sort() function. (which could be a merge-sort anyway). The built in .sort() seems to be about 10ms quicker, or about 14% quicker.

Only reason I would want to use my merge-sort (slower) is because I know for sure it will be implemented exactly the same across iOS, windows, android, etc...

回答1:

On Android it uses Android WebView which is based on Chromium, and uses the V8 JavaScript engine.

On iOS, as of iOS8 it uses the WKWebView which is based on Safari and uses the Nitro JavaScript engine.

On other platforms... well, whatever the native web view is.



回答2:

Cordova is, at the end of the day, a native app with a web view embedded inside, and it uses the web browser component specific to the platform where the app is deployed.

If you wish to use another Web browser component is still possible. Take a look at Crosswalk.