Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For #11961: collect telemetry on all unique unsupported features that… #11969

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,24 @@ const PDFViewerApplication = {
.catch(downloadByUrl); // Error occurred, try downloading with the URL.
},

_recordFallbackErrorTelemetry(featureId) {
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("MOZCENTRAL")) {
this.externalServices.reportTelemetry({
type: "unsupportedFeature",
featureId,
});
}
},

fallback(featureId) {
if (
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
) {
if (featureId) {
this._recordFallbackErrorTelemetry(featureId);
}

// For PDFs that contain script and form errors, we should only trigger
// the fallback once the user has interacted with the page.
if (this._delayedFallbackFeatureIds.length >= 1 && this._hasInteracted) {
Expand Down Expand Up @@ -1247,6 +1260,7 @@ const PDFViewerApplication = {
}
console.warn("Warning: JavaScript is not supported");
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.javaScript);
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.javaScript);
return true;
});

Expand Down Expand Up @@ -1329,6 +1343,7 @@ const PDFViewerApplication = {
if (info.IsAcroFormPresent) {
console.warn("Warning: AcroForm/XFA is not supported");
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.forms);
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.forms);
}

if (
Expand Down