diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 027d1aa68f79..310931653e56 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -11,6 +11,8 @@ ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.defineModuleGetter(this, "ActorManagerParent", "resource://gre/modules/ActorManagerParent.jsm"); +const PREF_PDFJS_ENABLED_CACHE_STATE = "pdfjs.enabledCache.state"; + let ACTORS = { AboutReader: { child: { @@ -993,7 +995,13 @@ BrowserGlue.prototype = { _beforeUIStartup: function BG__beforeUIStartup() { SessionStartup.init(); - PdfJs.earlyInit(); + if (Services.prefs.prefHasUserValue(PREF_PDFJS_ENABLED_CACHE_STATE)) { + Services.ppmm.sharedData.set( + "pdfjs.enabled", + Services.prefs.getBoolPref(PREF_PDFJS_ENABLED_CACHE_STATE)); + } else { + PdfJs.earlyInit(); + } // check if we're in safe mode if (Services.appinfo.inSafeMode) { diff --git a/browser/extensions/pdfjs/content/PdfJs.jsm b/browser/extensions/pdfjs/content/PdfJs.jsm index dca532702f63..9bf8c5c2e2bb 100644 --- a/browser/extensions/pdfjs/content/PdfJs.jsm +++ b/browser/extensions/pdfjs/content/PdfJs.jsm @@ -108,6 +108,8 @@ var PdfJs = { }, earlyInit() { + // Note: Please keep this in sync with the duplicated logic in + // nsBrowserGlue.js. Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled()); },