From b4e39eb71d2aab01f5dcfece45c038cb69fb3717 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 16 Apr 2021 07:11:19 +0000 Subject: [PATCH] Bug 1705327 - Remove infobar notification from pdf viewer r=bdahl Recommandation from UX is to not show this bar, so remove it. Differential Revision: https://phabricator.services.mozilla.com/D112163 --- .../pdfjs/content/PdfJsTelemetry.jsm | 7 ---- .../pdfjs/content/PdfStreamConverter.jsm | 38 +------------------ toolkit/components/pdfjs/test/browser.ini | 1 + toolkit/components/telemetry/Histograms.json | 13 +------ 4 files changed, 3 insertions(+), 56 deletions(-) diff --git a/toolkit/components/pdfjs/content/PdfJsTelemetry.jsm b/toolkit/components/pdfjs/content/PdfJsTelemetry.jsm index cb2cea7de476..18d8918581e9 100644 --- a/toolkit/components/pdfjs/content/PdfJsTelemetry.jsm +++ b/toolkit/components/pdfjs/content/PdfJsTelemetry.jsm @@ -24,13 +24,6 @@ var PdfJsTelemetry = { onViewerIsUsed() { Services.telemetry.scalarAdd("pdf.viewer.used", 1); }, - onFallbackShown(featureId) { - Services.telemetry.scalarAdd("pdf.viewer.fallback_shown", 1); - let histogram = Services.telemetry.getHistogramById( - "PDF_VIEWER_FALLBACK_REASON" - ); - histogram.add(featureId ?? "unknown"); - }, onFallbackError(featureId) { let histogram = Services.telemetry.getHistogramById( "PDF_VIEWER_FALLBACK_ERROR" diff --git a/toolkit/components/pdfjs/content/PdfStreamConverter.jsm b/toolkit/components/pdfjs/content/PdfStreamConverter.jsm index af2b1ec84caf..4348f179f245 100644 --- a/toolkit/components/pdfjs/content/PdfStreamConverter.jsm +++ b/toolkit/components/pdfjs/content/PdfStreamConverter.jsm @@ -174,13 +174,6 @@ function getLocalizedStrings(path) { } return map; } -function getLocalizedString(strings, id, property) { - property = property || "textContent"; - if (id in strings) { - return strings[id][property]; - } - return id; -} function isValidMatchesCount(data) { if (typeof data !== "object" || data === null) { @@ -576,36 +569,7 @@ class ChromeActions { * @param {function} sendResponse - Callback function. */ fallback(args, sendResponse) { - var featureId = args.featureId; - - var domWindow = this.domWindow; - var strings = getLocalizedStrings("chrome.properties"); - var message; - if (featureId === "forms") { - message = getLocalizedString(strings, "unsupported_feature_forms"); - } else if (featureId === "signatures") { - message = getLocalizedString(strings, "unsupported_feature_signatures"); - } else { - message = getLocalizedString(strings, "unsupported_feature"); - } - PdfJsTelemetry.onFallbackShown(featureId); - - // Request the display of a notification warning in the associated window - // when the renderer isn't sure a pdf displayed correctly. - let actor = getActor(domWindow); - if (actor) { - actor.sendAsyncMessage("PDFJS:Parent:displayWarning", { - message, - label: getLocalizedString(strings, "open_with_different_viewer"), - accessKey: getLocalizedString( - strings, - "open_with_different_viewer", - "accessKey" - ), - }); - - actor.fallbackCallback = sendResponse; - } + sendResponse(false); } updateFindControlState(data) { diff --git a/toolkit/components/pdfjs/test/browser.ini b/toolkit/components/pdfjs/test/browser.ini index e252d9148b33..2bb4c77fac81 100644 --- a/toolkit/components/pdfjs/test/browser.ini +++ b/toolkit/components/pdfjs/test/browser.ini @@ -24,6 +24,7 @@ support-files = file_pdfjs_object_stream.pdf file_pdfjs_object_stream.pdf^headers^ [browser_pdfjs_notification_close_on_navigation.js] +skip-if = true # see bug 1705327 [browser_pdfjs_octet_stream.js] support-files = file_pdfjs_object_stream.pdf diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 9cc2b89d9867..6679b16f4851 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -10096,17 +10096,6 @@ "n_buckets": 50, "description": "Time spent to display first page in PDF Viewer (ms)" }, - "PDF_VIEWER_FALLBACK_REASON": { - "record_in_processes": ["content"], - "products": ["firefox"], - "expires_in_version": "92", - "alert_emails": ["bdahl@mozilla.com"], - "releaseChannelCollection": "opt-out", - "bug_numbers": [1630844, 1666979, 1689264], - "kind": "categorical", - "labels": ["unknown", "forms", "javaScript", "signatures", "smask", "shadingPattern", "font", "errorTilingPattern", "errorExtGState", "errorXObject", "errorFontLoadType3", "errorFontState", "errorFontMissing", "errorFontTranslate", "errorColorSpace", "errorOperatorList", "errorFontToUnicode", "errorFontLoadNative", "errorFontGetPath"], - "description": "The reason the fallback bar was shown." - }, "PDF_VIEWER_FALLBACK_ERROR": { "record_in_processes": ["main", "content"], "products": ["firefox"], @@ -10115,7 +10104,7 @@ "releaseChannelCollection": "opt-out", "bug_numbers": [1643402, 1666979, 1689264], "kind": "categorical", - "labels": ["unknown", "forms", "javaScript", "smask", "shadingPattern", "font", "errorTilingPattern", "errorExtGState", "errorXObject", "errorFontLoadType3", "errorFontState", "errorFontMissing", "errorFontTranslate", "errorColorSpace", "errorOperatorList", "errorFontToUnicode", "errorFontLoadNative", "errorFontGetPath"], + "labels": ["unknown", "forms", "javaScript", "signatures", "smask", "shadingPattern", "font", "errorTilingPattern", "errorExtGState", "errorXObject", "errorFontLoadType3", "errorFontState", "errorFontMissing", "errorFontTranslate", "errorColorSpace", "errorOperatorList", "errorFontToUnicode", "errorFontLoadNative", "errorFontGetPath"], "description": "All errors that could trigger the fallback bar, even after the bar is shown." }, "PDF_VIEWER_TAGGED": {