Stop checking for the response
property, on XMLHttpRequest
, when setting up the WorkerMessageHandler
This check was added in PR 2445, however it's no longer necessary since all data[1] is now loaded on the main-thread (and then transferred to the worker-thread). Furthermore, by default the Fetch API is now (usually) used rather than `XMLHttpRequest`. All in all, while these checks *were* necessary at one point that's no longer the case and they can thus be removed. --- [1] This includes both the actual PDF data, as well as the CMap data.
This commit is contained in:
parent
7e37eb42ad
commit
7212ff4eea
@ -73,19 +73,7 @@ var WorkerMessageHandler = {
|
||||
// making sure postMessage transfers are working
|
||||
var supportTransfers = data[0] === 255;
|
||||
handler.postMessageTransfers = supportTransfers;
|
||||
// check if the response property is supported by xhr
|
||||
var xhr = new XMLHttpRequest();
|
||||
var responseExists = 'response' in xhr;
|
||||
// check if the property is actually implemented
|
||||
try {
|
||||
xhr.responseType; // eslint-disable-line no-unused-expressions
|
||||
} catch (e) {
|
||||
responseExists = false;
|
||||
}
|
||||
if (!responseExists) {
|
||||
handler.send('test', false);
|
||||
return;
|
||||
}
|
||||
|
||||
handler.send('test', {
|
||||
supportTypedArray: true,
|
||||
supportTransfers,
|
||||
|
Loading…
Reference in New Issue
Block a user