Javascript: window.saveAs in android Webview -
i using code save client-generated png files:
my_canvas.toblob (function (blob) {window.saveas (blob, my_filename)}, 'image/png')
i'm using these cross-browser compatibility:
- javascript canvas blob 2.0.5 sebastian tschan, https://github.com/blueimp/javascript-canvas-to-blob.
- filesaver.js eli grey, http://eligrey.com.
works in ie10+, chrome, firefox, chrome android, breaks down in base web view engine in 4.3. since i'm trying lightly use phonegap here , make compatible non-new current devices mobile, need work in android webview 4.3, @ least.
q & a:
q: how break down?
a: sends me non-existent url instead of making image , opening it.
i've had many problems canvas, blobs , old versions of android.
on version have use blobbuilder, on others webkitblobbuilder (on versions blobbuilder there not correctly implemented), canvas.todataurl not present before android 3 , not work correctly before 4.x...
for reasons used canvas2imageplugin android devices , app works in android 2.3.
you can keep code browser testing window.canvas2imageplugin , using if it's found , continue you've been doing if it's not.
Comments
Post a Comment