From 7212ff4eeac2696b2733bb8de09dbb5e0715d8bc Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 5 Sep 2019 10:08:54 +0200 Subject: [PATCH] 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. --- src/core/worker.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/core/worker.js b/src/core/worker.js index 4da105f89..17a44d88d 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -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,