Sep 04

Three.js and webview

Category: Linux,WWW   — Published by goeszen on September 4, 2015 at 2:15 pm

Recently, I did some development of a webapp which was using threejs for display of geometry in a WebGL view.
The prototype worked great when I decided to move it into a cordova based webapp, to remove the need for a webserver,
and make it self-contained, it stopped working.

The surprise: what was working in the desktop browser did not work under cordova, in a webview.
This took me some hours to find out. The problem is, cordova uses the "Android Browser" for its webviews,
a webkit browser which is somewhat behind. Many people already call it "the IE6 of Android". The
Android Browser does not support threejs, not in WebGL mode, nor in CanvasRenderer mode.

The best option seems to be to use crosswalk project, in codova version 4+ you can use it as a plugin. It bundles a full (and recent) browser and replaces the native webview normally used by cordova.

Leave a Reply