mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Move the disableCreateObjectURL
option from the global PDFJS
object and into getDocument
instead
This commit is contained in:
parent
05c05bdef5
commit
1d03ad0060
11 changed files with 54 additions and 36 deletions
|
@ -178,6 +178,9 @@ function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
|
|||
* The default value is `false`.
|
||||
* NOTE: It is also necessary to disable streaming, see above,
|
||||
* in order for disabling of pre-fetching to work correctly.
|
||||
* @property {boolean} disableCreateObjectURL - (optional) Disable the use of
|
||||
* `URL.createObjectURL`, for compatibility with older browsers.
|
||||
* The default value is `false`.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -289,6 +292,10 @@ function getDocument(src) {
|
|||
if (typeof params.disableAutoFetch !== 'boolean') {
|
||||
params.disableAutoFetch = false;
|
||||
}
|
||||
if (typeof params.disableCreateObjectURL !== 'boolean') {
|
||||
params.disableCreateObjectURL =
|
||||
apiCompatibilityParams.disableCreateObjectURL || false;
|
||||
}
|
||||
|
||||
// Set the main-thread verbosity level.
|
||||
setVerbosityLevel(params.verbosity);
|
||||
|
@ -373,7 +380,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|||
},
|
||||
maxImageSize: source.maxImageSize,
|
||||
disableFontFace: source.disableFontFace,
|
||||
disableCreateObjectURL: getDefaultSetting('disableCreateObjectURL'),
|
||||
disableCreateObjectURL: source.disableCreateObjectURL,
|
||||
postMessageTransfers: worker.postMessageTransfers,
|
||||
docBaseUrl: source.docBaseUrl,
|
||||
nativeImageDecoderSupport: source.nativeImageDecoderSupport,
|
||||
|
@ -2148,6 +2155,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||
disableRange: params.disableRange,
|
||||
disableStream: params.disableStream,
|
||||
disableAutoFetch: params.disableAutoFetch,
|
||||
disableCreateObjectURL: params.disableCreateObjectURL,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue