From a0e84877ffe326fa31ed26dc794ae9b9a163ae97 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 24 Nov 2017 23:49:08 +0100 Subject: [PATCH] fix JS errors about disabled stuff --- default.nix | 3 ++- disable-pdfjs.patch | 41 +++++++++++++++++++++++++++++++++++++++++ disable-reader.patch | 13 +++++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 disable-pdfjs.patch diff --git a/default.nix b/default.nix index 4867a1c..9232e90 100644 --- a/default.nix +++ b/default.nix @@ -14,11 +14,12 @@ let ./disable-datasharing-infobar.patch ./disable-locationservice.patch ./disable-sponsored-tiles.patch + ./disable-send-to-device.patch ./disable-system-addons.patch ./disable-telemetry.patch ./disable-reader.patch ./disable-pocket.patch - ./disable-send-to-device.patch + ./disable-pdfjs.patch ./disable-dbus.patch ./preferences.patch ]; diff --git a/disable-pdfjs.patch b/disable-pdfjs.patch new file mode 100644 index 0000000..224c989 --- /dev/null +++ b/disable-pdfjs.patch @@ -0,0 +1,41 @@ +--- a/browser/components/nsBrowserGlue.js ++++ b/browser/components/nsBrowserGlue.js +@@ -47,7 +47,6 @@ + OS: "resource://gre/modules/osfile.jsm", + PageActions: "resource:///modules/PageActions.jsm", + PageThumbs: "resource://gre/modules/PageThumbs.jsm", +- PdfJs: "resource://pdf.js/PdfJs.jsm", + PermissionUI: "resource:///modules/PermissionUI.jsm", + PingCentre: "resource:///modules/PingCentre.jsm", + PlacesBackups: "resource://gre/modules/PlacesBackups.jsm", +@@ -505,14 +504,6 @@ + this._updateFxaBadges(); + break; + case "handlersvc-store-initialized": +- // Initialize PdfJs when running in-process and remote. This only +- // happens once since PdfJs registers global hooks. If the PdfJs +- // extension is installed the init method below will be overridden +- // leaving initialization to the extension. +- // parent only: configure default prefs, set up pref observers, register +- // pdf content handler, and initializes parent side message manager +- // shim for privileged api access. +- PdfJs.init(true); + break; + case "shield-init-complete": + this._sendMainPingCentrePing(); +@@ -866,15 +857,6 @@ + + // the first browser window has finished initializing + _onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) { +- // Set up listeners and, if PdfJs is enabled, register the PDF stream converter. +- // We delay all of the parent's initialization other than stream converter +- // registration, because it requires file IO from nsHandlerService-json.js +- Services.ppmm.loadProcessScript("resource://pdf.js/pdfjschildbootstrap.js", true); +- if (PdfJs.enabled) { +- PdfJs.ensureRegistered(); +- Services.ppmm.loadProcessScript("resource://pdf.js/pdfjschildbootstrap-enabled.js", true); +- } +- + TabCrashHandler.init(); + if (AppConstants.MOZ_CRASHREPORTER) { + PluginCrashReporter.init(); diff --git a/disable-reader.patch b/disable-reader.patch index f8a6aaa..b05a49e 100644 --- a/disable-reader.patch +++ b/disable-reader.patch @@ -222,8 +222,8 @@ [browser_sessionHistory.js] support-files = file_sessionHistory_hashchange.html ---- a/browser/base/content/urlbarBindings.xml 2017-11-02 -+++ b/browser/base/content/urlbarBindings.xml 2017-11-24 +--- a/browser/base/content/urlbarBindings.xml ++++ b/browser/base/content/urlbarBindings.xml @@ -230,11 +230,6 @@ break; } @@ -263,6 +263,15 @@