diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm index 14b12becd..0e917162a 100644 --- a/extensions/firefox/content/PdfStreamConverter.jsm +++ b/extensions/firefox/content/PdfStreamConverter.jsm @@ -423,6 +423,12 @@ ChromeActions.prototype = { } return true; }, + supportedMouseWheelZoomModifierKeys: function() { + return { + ctrlKey: getIntPref('mousewheel.with_control.action', 3) === 3, + metaKey: getIntPref('mousewheel.with_meta.action', 1) === 3, + }; + }, reportTelemetry: function (data) { var probeInfo = JSON.parse(data); switch (probeInfo.type) { diff --git a/web/viewer.js b/web/viewer.js index 32ed42843..53d298427 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -394,6 +394,18 @@ var PDFViewerApplication = { return PDFJS.shadow(this, 'loadingBar', bar); }, + get supportedMouseWheelZoomModifierKeys() { + var support = { + ctrlKey: true, + metaKey: true, + }; +//#if (FIREFOX || MOZCENTRAL) +// support = FirefoxCom.requestSync('supportedMouseWheelZoomModifierKeys'); +//#endif + + return PDFJS.shadow(this, 'supportedMouseWheelZoomModifierKeys', support); + }, + //#if (FIREFOX || MOZCENTRAL) initPassiveLoading: function pdfViewInitPassiveLoading() { function FirefoxComDataRangeTransport(length, initialData) { @@ -1845,6 +1857,11 @@ function handleMouseWheel(evt) { PDFViewerApplication.scrollPresentationMode(ticks * MOUSE_WHEEL_DELTA_FACTOR); } else if (evt.ctrlKey || evt.metaKey) { + var support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys; + if ((evt.ctrlKey && !support.ctrlKey) || + (evt.metaKey && !support.metaKey)) { + return; + } // Only zoom the pages, not the entire viewer. evt.preventDefault(); PDFViewerApplication[direction](Math.abs(ticks));