Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 14
Registered: ‎02-09-2011
My Device: Not Specified

webworker blackberry torch v6.0.0.448

[ Edited ]



I have localStorage inside my application, and recently after updating to version, it doesn't seem to allow me to use it anymore.


Version works.


Anyone else having this problem?


EDIT: Not getting any errors about localStorage no longer exist, but when I try to add a large string (186kb) and then something else, the application just exit without any exceptions.

Posts: 14
Registered: ‎02-09-2011
My Device: Not Specified

Re: no localstorage blackberry torch v6.0.0.448

[ Edited ]

After some more testing and changing my code to use sqlite, looked like the application closing is coming from the Web Worker.


var object = new Object();
object.Product2 = products;
object.UsedProduct = usedProducts;
object.property = 0;
object.category = category;
object.subCategory = subCategory;
var worker = new Worker("javascript/worker.js");

worker.onmessage = function(event) {

    // Do some stuff here




The application seem to be crashing on the postMessage call. worker.onerror didn't product any errors nor did putting try/catch around the postMessage.


The size of the object is quite large, so I'm not sure if that causing the problem or if there is too many background thread because of a bunch of sqlite calls that hasn't returned yet.


Again everything works on simulator and v6.0.0.248.

Posts: 14
Registered: ‎02-09-2011
My Device: Not Specified

Re: webworker blackberry torch v6.0.0.448

Found the real problem seem like when the worker send a message back, the string is too large (it a html string).


Anyone know if there is a workaround? I don't get why this would break between version and version


The application need to use webworker because if not, it freezes the main event and application crashs.