[Firefox] Slightly simplify how the generator is determined, when sending telemetry data from the viewer

When working on PR 11463 I couldn't help thinking that the `Array.prototype.some` callback function, used when determining the generator, was somewhat difficult to read with its partly unused and strangely named parameters.
This commit is contained in:
Jonas Jenwald 2020-01-02 23:19:14 +01:00
parent b833f84307
commit 299ba44bb9

View File

@ -1365,16 +1365,16 @@ const PDFViewerApplication = {
"fpdf", "fpdf",
]; ];
if (info.Producer) { if (info.Producer) {
KNOWN_GENERATORS.some( const producer = info.Producer.toLowerCase();
function(generator, s, i) { KNOWN_GENERATORS.some(function(generator) {
if (!generator.includes(s)) { if (!producer.includes(generator)) {
return false; return false;
} }
generatorId = s.replace(/[ .\-]/g, "_"); generatorId = generator.replace(/[ .\-]/g, "_");
return true; return true;
}.bind(null, info.Producer.toLowerCase()) });
);
} }
const formType = !info.IsAcroFormPresent const formType = !info.IsAcroFormPresent
? null ? null
: info.IsXFAPresent : info.IsXFAPresent