Fix WidgetAnnotationElement._getKeyModifier to account for Linux

Currently the `WidgetAnnotationElement._getKeyModifier` method will always be falsy on Linux, which seems like a simple oversight. Looking at all the other `FeatureTest.platform` accesses we only handle the `isMac`-case specially, and it seems reasonable to do the same thing here.
The reason that this hasn't led to any bug reports is most likely that the `modifier`-property seems completely unused in the scripting-implementation.

Finally, with these changes we can (slightly) simplify the `FeatureTest.platform` implementation.
This commit is contained in:
Jonas Jenwald 2023-10-26 13:36:42 +02:00
parent fbfacf8828
commit 069096e78f
2 changed files with 2 additions and 4 deletions

View file

@ -619,10 +619,9 @@ class FeatureTest {
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
typeof navigator === "undefined"
) {
return shadow(this, "platform", { isWin: false, isMac: false });
return shadow(this, "platform", { isMac: false });
}
return shadow(this, "platform", {
isWin: navigator.platform.includes("Win"),
isMac: navigator.platform.includes("Mac"),
});
}