Merge pull request #11522 from Snuffleupagus/viewer-reportTelemetry

Ensure that the viewer telemetry reporting, and fallback code, runs in development mode and GENERIC builds
This commit is contained in:
Tim van der Meij 2020-01-20 23:33:49 +01:00 committed by GitHub
commit ead03b513c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -850,8 +850,8 @@ const PDFViewerApplication = {
fallback(featureId) {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("FIREFOX || MOZCENTRAL")
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
) {
// Only trigger the fallback once so we don't spam the user with messages
// for one PDF.
@ -1325,8 +1325,8 @@ const PDFViewerApplication = {
}
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("FIREFOX || MOZCENTRAL")
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
) {
// Telemetry labels must be C++ variable friendly.
let versionId = "other";
@ -1556,8 +1556,8 @@ const PDFViewerApplication = {
printService.layout();
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("FIREFOX || MOZCENTRAL")
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
) {
this.externalServices.reportTelemetry({
type: "print",
@ -1870,8 +1870,8 @@ function webViewerInitialized() {
}
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("FIREFOX || MOZCENTRAL") &&
(typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")) &&
!PDFViewerApplication.supportsDocumentFonts
) {
AppOptions.set("disableFontFace", true);
@ -1998,8 +1998,8 @@ function webViewerPageRendered(evt) {
}
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("FIREFOX || MOZCENTRAL")
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
) {
PDFViewerApplication.externalServices.reportTelemetry({
type: "pageInfo",