diff --git a/web/app.js b/web/app.js index 125a56644..3a66de48a 100644 --- a/web/app.js +++ b/web/app.js @@ -2274,39 +2274,19 @@ function webViewerInitialized() { } } -let webViewerOpenFileViaURL; -if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { - webViewerOpenFileViaURL = function (file) { - if (file && file.lastIndexOf("file:", 0) === 0) { - // file:-scheme. Load the contents in the main thread because QtWebKit - // cannot load file:-URLs in a Web Worker. file:-URLs are usually loaded - // very quickly, so there is no need to set up progress event listeners. - PDFViewerApplication.setTitleUsingUrl(file); - const xhr = new XMLHttpRequest(); - xhr.onload = function () { - PDFViewerApplication.open(new Uint8Array(xhr.response)); - }; - xhr.open("GET", file); - xhr.responseType = "arraybuffer"; - xhr.send(); - return; - } - +function webViewerOpenFileViaURL(file) { + if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { if (file) { PDFViewerApplication.open(file); } - }; -} else if (PDFJSDev.test("MOZCENTRAL || CHROME")) { - webViewerOpenFileViaURL = function (file) { + } else if (PDFJSDev.test("MOZCENTRAL || CHROME")) { PDFViewerApplication.setTitleUsingUrl(file); PDFViewerApplication.initPassiveLoading(); - }; -} else { - webViewerOpenFileViaURL = function (file) { + } else { if (file) { throw new Error("Not implemented: webViewerOpenFileViaURL"); } - }; + } } function webViewerResetPermissions() {