From 39e0b4b5895a69b014677c215ef1fbcfa6388577 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Thu, 8 Mar 2018 18:44:12 +0100 Subject: [PATCH] [CRX] Fix error that broke the Chrome extension PR #9493 moved from `appConfig.defaultUrl` to `AppOptions.get('defaultUrl')`. However, it forgot to replace `appConfig.defaultUrl` in chromecom.js, and as a result the extension is not able to open any PDF file. This patch fixes that issue. --- web/chromecom.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/chromecom.js b/web/chromecom.js index 20429d8c1..173ca02ab 100644 --- a/web/chromecom.js +++ b/web/chromecom.js @@ -15,6 +15,7 @@ /* globals chrome */ import { DefaultExternalServices, PDFViewerApplication } from './app'; +import { AppOptions } from './app_options'; import { BasePreferences } from './preferences'; import { DownloadManager } from './download_manager'; import { GenericL10n } from './genericl10n'; @@ -357,8 +358,9 @@ class ChromePreferences extends BasePreferences { let ChromeExternalServices = Object.create(DefaultExternalServices); ChromeExternalServices.initPassiveLoading = function(callbacks) { - let { appConfig, overlayManager, } = PDFViewerApplication; - ChromeCom.resolvePDFFile(appConfig.defaultUrl, overlayManager, + let { overlayManager, } = PDFViewerApplication; + // defaultUrl is set in viewer.js + ChromeCom.resolvePDFFile(AppOptions.get('defaultUrl'), overlayManager, function(url, length, originalURL) { callbacks.onOpenWithURL(url, length, originalURL); });