1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Adds initial telemetry probes

This commit is contained in:
Yury Delendik 2013-08-16 09:53:05 -05:00
parent 5ca1c84564
commit ba23a9e8f9
6 changed files with 237 additions and 3 deletions

View file

@ -1020,6 +1020,34 @@ var PDFView = {
console.warn('Warning: AcroForm/XFA is not supported');
PDFView.fallback();
}
//#if (FIREFOX || MOZCENTRAL)
// var versionId = String(info.PDFFormatVersion).slice(-1) | 0;
// var generatorId = 0;
// var KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwritter",
// "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript",
// "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext",
// "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle",
// "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"];
// var generatorId = 0;
// if (info.Producer) {
// KNOWN_GENERATORS.some(function (generator, s, i) {
// if (generator.indexOf(s) < 0) {
// return false;
// }
// generatorId = i + 1;
// return true;
// }.bind(null, info.Producer.toLowerCase()));
// }
// var formType = !info.IsAcroFormPresent ? null : info.IsXFAPresent ?
// 'xfa' : 'acroform';
// FirefoxCom.request('reportTelemetry', JSON.stringify({
// type: 'documentInfo',
// version: versionId,
// generator: generatorId,
// formType: formType
// }));
//#endif
});
},
@ -1928,6 +1956,12 @@ var PageView = function pageView(container, id, scale,
});
div.dispatchEvent(event);
//#if (FIREFOX || MOZCENTRAL)
// FirefoxCom.request('reportTelemetry', JSON.stringify({
// type: 'pageInfo'
// }));
// // TODO add stream types report here
//#endif
callback();
}