Fix crash on firefox

https://bugzilla.mozilla.org/show_bug.cgi?id=879717
Hack different solution for firefox
Use ArrayBuffer for perf