Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your example is similar to <a href="https://developer.mozilla.org/En/Using_workers_in_extensions" rel="nofollow">this firefox example</a> except for the loop inside the worker making multiple <strong>ajax</strong> requests. I'd be curious to know what is causing the failure. You might be hitting a limit on the number of concurrent <strong>ajax</strong> connections a single worker can process. </p> <p>Could you try moving the url for loop to the main gui thread: </p> <pre><code>for(var i = 0; i &lt; urls.length; i++){ worker.postMessage(urls[i]); } </code></pre> <p>and change your worker to just do a single <strong>ajax</strong> call at a time? </p> <pre><code>self.addEventListener('message', function(e){ try { var xhr=new XMLHttpRequest() xhr.open('GET', e.data, true); xhr.setRequestHeader('Accept', 'application/json'); xhr.send(null); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (xhr.status == 200 || xhr.status == 304 || xhr.status ==0) { postMessage(xhr.responseText); } else { postMessage(xhr.status + xhr.responseText); throw xhr.status + xhr.responseText; } } }; } catch (e) { postMessage("ERROR:"+e.message); } }, false); </code></pre> <p>and see if that works? </p> <hr> <p>The <a href="https://developer.mozilla.org/en/Using_web_workers" rel="nofollow">mozilla example</a> has some error handlers that might reveal the problem. You might try adding in the main GUI thread: </p> <pre><code>worker.onerror = function(error) { dump("Worker error: " + error.message + "\n"); throw error; }; </code></pre> <p>and inside the worker:</p> <pre><code>function errorReceiver(event) { throw event.data; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload