Skip to Content
Platform.Ontology

Keyboard Map (layout leak)

Reveals the physical-to-printed key mapping, i.e. the keyboard layout.

Gets silentlyTyping and clipboardKeyboardWeb browsersWhile you use it

In one line

Can tell your keyboard layout, which hints at your country and language

Reveals the physical-to-printed key mapping, i.e. the keyboard layout.

Shows which keyboard layout the person uses (QWERTY, AZERTY, Dvorak, language), a strong locale and fingerprint signal. No prompt.

What it can and can't do

What the user does: Nothing. It happens when the page or app loads

It can

  • Check which character each physical key produces
  • Guess your language or region from that layout
  • Add to a profile of your device to help recognise you

It cannot

  • See what you type
  • Work in Firefox or Safari
  • Show a permission pop up; there is none
  • Work outside secure (https) pages

How it differs between platforms: Only Chrome and Edge on desktop support it. Firefox, Safari and most phones do not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported692018-09-04None
EdgeSupported792020-01-15None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidNot supportedNot availableNot listedNone
Samsung InternetNot supportedNot availableNot listedNone

How a site asks for it

APInavigator.keyboard.getLayoutMap()
Permissions policykeyboard-map
Browser compat keysapi.Keyboard.getLayoutMap
How access is grantednone
What the user seesNo prompt; Chromium exposes it to secure contexts.
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsn/a
How to take it backn/a
Inside an iframeNeeds allow="keyboard-map"

Typical flow

  1. Call getLayoutMap()
  2. Read KeyboardLayoutMap of key codes to characters

Data you get

What comes back: KeyboardLayoutMap
Shape: object
How often: on call

FieldTypeUnitRangePrecision
entriesintegerkeysabout 48 mappable keys1

Technical limits

  • Chromium only
  • No key press data

The story

What it is

Reveals which physical key makes which letter, so the page learns your keyboard layout.

For you

You see nothing. The page quietly learns whether your keyboard is QWERTY, AZERTY, Dvorak or another layout. No prompt appears. It may be used to guess your country.

For makers

Makers of games and editors use it for correct key labels. Fraud and tracking systems also use it as a free hint to your language, and in a fingerprint it adds a few bits of uniqueness.

Where you see it

TypeExampleApps
gamesA browser game rebinds its movement keys to fit a Dvorak or AZERTY keyboard so players are not stuck with wrong keys.Krunker.io, Minecraft Classic
creativeA music web app maps piano keys to the correct physical row on any layout.Soundtrap, BandLab
adsAn ad network adds the layout to a profile and guesses a user's language when other signals are missing.None named
analyticsA fingerprinting script mixes layout, fonts and screen size to spot returning visitors.None named
securityA fraud engine flags an order that claims to be in Germany but types on a Russian layout.None named
developerA coding web app shows the correct shortcut key names for each layout.None named

Risks

  • Layout hints at country
  • No prompt

Good uses and abuse

Legitimate uses

  • Showing correct key hints in games

Known abuse

  • Layout fingerprinting

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility2 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

History

  • 2018-09, Chrome 69: Keyboard Map ships
  • Keyboard Lock. Can capture keys like Escape and Alt+Tab while the page is full screen

Sources

How well checked: Based on official documentation.

On this page