Merge pull request #11969 from emalysz/11961-unsupported-feature-telemetry-error
For #11961: collect telemetry on all unique unsupported features that…
This commit is contained in:
commit
d75a068212
15
web/app.js
15
web/app.js
@ -864,11 +864,24 @@ const PDFViewerApplication = {
|
|||||||
.catch(downloadByUrl); // Error occurred, try downloading with the URL.
|
.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) {
|
fallback(featureId) {
|
||||||
if (
|
if (
|
||||||
typeof PDFJSDev === "undefined" ||
|
typeof PDFJSDev === "undefined" ||
|
||||||
PDFJSDev.test("MOZCENTRAL || GENERIC")
|
PDFJSDev.test("MOZCENTRAL || GENERIC")
|
||||||
) {
|
) {
|
||||||
|
if (featureId) {
|
||||||
|
this._recordFallbackErrorTelemetry(featureId);
|
||||||
|
}
|
||||||
|
|
||||||
// For PDFs that contain script and form errors, we should only trigger
|
// For PDFs that contain script and form errors, we should only trigger
|
||||||
// the fallback once the user has interacted with the page.
|
// the fallback once the user has interacted with the page.
|
||||||
if (this._delayedFallbackFeatureIds.length >= 1 && this._hasInteracted) {
|
if (this._delayedFallbackFeatureIds.length >= 1 && this._hasInteracted) {
|
||||||
@ -1247,6 +1260,7 @@ const PDFViewerApplication = {
|
|||||||
}
|
}
|
||||||
console.warn("Warning: JavaScript is not supported");
|
console.warn("Warning: JavaScript is not supported");
|
||||||
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.javaScript);
|
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.javaScript);
|
||||||
|
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.javaScript);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1329,6 +1343,7 @@ const PDFViewerApplication = {
|
|||||||
if (info.IsAcroFormPresent) {
|
if (info.IsAcroFormPresent) {
|
||||||
console.warn("Warning: AcroForm/XFA is not supported");
|
console.warn("Warning: AcroForm/XFA is not supported");
|
||||||
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.forms);
|
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.forms);
|
||||||
|
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.forms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user