mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Re-factor setPDFNetworkStreamFactory
, in src/display/api.js, to also accept an asynchronous function
As part of trying to reduce the usage of SystemJS in the development viewer, this patch is a necessary step that will allow removal of some `require` statements. Currently this uses `SystemJS.import` in non-PRODUCTION mode, but it should be possible to replace those with standard *dynamic* `import` calls in the future.
This commit is contained in:
parent
0960e6c0b5
commit
d4d933538b
4 changed files with 72 additions and 32 deletions
|
@ -26,6 +26,12 @@ import {
|
|||
validateResponseStatus,
|
||||
} from "./network_utils.js";
|
||||
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
throw new Error(
|
||||
'Module "./fetch_stream.js" shall not be used with MOZCENTRAL builds.'
|
||||
);
|
||||
}
|
||||
|
||||
function createFetchOptions(headers, withCredentials, abortController) {
|
||||
return {
|
||||
method: "GET",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue