Incorrect KeyboardEvent are created when the Cyrillic keyboard is used with `privacy.resistFingerprinting = true`
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: kozackunisoft, Unassigned)
Details
Attachments
(1 file)
345.03 KB,
image/gif
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
- Create
keydown
event listener:
window.addEventListener('keydown', console.log)
- Press some key, for example
L
. In browser console you should saw log with new event. - Change the keyboard layout. In my case it is the Ukrainian language (Cyrillic).
- Press same key.
Reproduction demo:
https://codepen.io/cawa-93/pen/YzZvajb?editors=1010
Actual results:
In first case (on English/Latin) I got KeyboardEvent:
{
code: "KeyL",
key: "L",
keyCode: 76,
}
But in second case (on Ukrainian/Cyrillic) I got KeyboardEvent:
{
code: "",
key: "Д",
keyCode: 0,
}
Expected results:
In second case must creating similar KeyboardEvent with same, language-insensitive code
.
If you open my Reproduction demo and press "W" you should see alert. In Firefox it works only for Latin keyboard. In other browser (In my case it's Edge) it work in latin and cyrillic keyboards.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 3•3 years ago
•
|
||
With Nightly and Firefox 89, this works as expected on Ubuntu 20.04.
I Agree. In nightly (91.0a1 (2021-06-07)) is work as expected. I faced the problem in Developer edition 90.0b4.
Comment 5•3 years ago
•
|
||
Unfortunately I was not able to reproduce this issue on Windows 10 Insider Preview using Developer Edition 90.0b4 (en-US and uk).
I installed Ukrainian (Enhanced) keyboard layout on my PC (I also tried with Azerbaijani (Cyrillic)), I then visited the demo page from comment 0 https://codepen.io/cawa-93/pen/YzZvajb?editors=1010.
If I hit L
or Д
I still got the same value for code
and that is KeyL
, Also hitting W
or Ц
brings up the modal alert.
Looks like a problem leads some browser settings. Previously, I reported that for me in the Nightly 91.0a1 all works as expected. However, if I enable sync in the Nightly with my firefox accounting - then again I have this problem.
Even if I turn off the synchronization, or exit my account - the problem remains.
If I go to https://support.mozilla.org/en-us/kb/refresh-firefox-Reset-ADD-ons-and-Settings and Restore browser - all works again as expected until I have been on synchronization.
What additional information can I provide?
After experimenting for a while, I found that this problem occurs (in 91.0a and 90.0b4) if the privacy.resistFingerprinting
parameter is true
.
Can somebody confirm that?
Comment 8•3 years ago
|
||
(In reply to Alex from comment #7)
After experimenting for a while, I found that this problem occurs (in 91.0a and 90.0b4) if the
privacy.resistFingerprinting
parameter istrue
.
Can somebody confirm that?
I can confirm that having privacy.resistFingerprinting
set to true
will indeed cause the issue reported in comment 0.
I used mozregression in order to see what might have caused this and ended up with the following pushlog (it's a very old one): https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e4107773cffb1baefd5446666fce22c4d6eb0517&tochange=b2cb61e83ac50115a28f04aaa8a32d4db90aad23
Comment 9•3 years ago
|
||
Alex, Bogdan: thanks for your efforts.
This seems intended; from https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting:
"Your keyboard layout and language is disguised ".
Reporter | ||
Comment 10•3 years ago
|
||
(In reply to Mirko Brodesser (:mbrodesser) from comment #9)
Alex, Bogdan: thanks for your efforts.
This seems intended; from https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting:
"Your keyboard layout and language is disguised ".
But the current behavior is the exact opposite:
"Your keyboard layout and language is disguised ".
The client can still read the key
(which is dependent on the installed language and keyboard layout).
Instead of masking, it just destroys keyboard shortcut support on most websites (such as YouTube). For this to work as intended instead of there events:
{
code: "",
key: "Д",
keyCode: 0,
}
it should create events the following:
{
code: "KeyL",
key: "",
keyCode: 76,
}
or
{
code: "KeyL",
key: "L",
keyCode: 76,
}
... for ANY keyboard layout and language.
Updated•3 years ago
|
Description
•