mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +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
|
@ -55,7 +55,7 @@ const DefaultExternalServices = {
|
|||
initPassiveLoading(callbacks) {},
|
||||
fallback(data, callback) {},
|
||||
reportTelemetry(data) {},
|
||||
createDownloadManager() {
|
||||
createDownloadManager(options) {
|
||||
throw new Error('Not implemented: createDownloadManager');
|
||||
},
|
||||
createPreferences() {
|
||||
|
@ -357,7 +357,9 @@ let PDFViewerApplication = {
|
|||
});
|
||||
this.pdfLinkService = pdfLinkService;
|
||||
|
||||
let downloadManager = this.externalServices.createDownloadManager();
|
||||
let downloadManager = this.externalServices.createDownloadManager({
|
||||
disableCreateObjectURL: AppOptions.get('disableCreateObjectURL'),
|
||||
});
|
||||
this.downloadManager = downloadManager;
|
||||
|
||||
let container = appConfig.mainContainer;
|
||||
|
@ -1873,7 +1875,7 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
|
|||
webViewerFileInputChange = function webViewerFileInputChange(evt) {
|
||||
let file = evt.fileInput.files[0];
|
||||
|
||||
if (!PDFJS.disableCreateObjectURL && URL.createObjectURL) {
|
||||
if (URL.createObjectURL && !AppOptions.get('disableCreateObjectURL')) {
|
||||
PDFViewerApplication.open(URL.createObjectURL(file));
|
||||
} else {
|
||||
// Read the local file into a Uint8Array.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue