Tests presence of the xhr-response in the worker
This commit is contained in:
parent
9583cb7108
commit
0e70aacc51
3 changed files with 55 additions and 3 deletions
|
@ -17,7 +17,16 @@
|
|||
|
||||
onmessage = function (e) {
|
||||
var data = e.data;
|
||||
postMessage({action: 'test', result: data.action == 'test' &&
|
||||
data.data instanceof Uint8Array});
|
||||
switch (data.action) {
|
||||
case 'test':
|
||||
postMessage({action: 'test', result: data.data instanceof Uint8Array});
|
||||
break;
|
||||
case 'xhr':
|
||||
var xhr = new XMLHttpRequest();
|
||||
var responseExists = 'response' in xhr || 'mozResponse' in xhr ||
|
||||
'responseArrayBuffer' in xhr || 'mozResponseArrayBuffer' in xhr;
|
||||
postMessage({action: 'xhr', result: responseExists});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue