[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:
parent
b833f84307
commit
299ba44bb9
18
web/app.js
18
web/app.js
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user