cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas, also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")!
@@ -10,9 +10,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var _videoTextures = {};
var _canvas;
- //
+ // cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,
+ // also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")!
- var useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined';
+ var useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'
+ && (new OffscreenCanvas(1, 1).getContext("2d")) !== null;
function createCanvas( width, height ) {