Skip to Content
Platform.Ontology

Gamepad presence

Lists connected game controllers, but only after a button press on the controller.

Gets silentlyDevice detailsInput hardwareWeb browsersWhen the page loadsWhile you use it

In one line

Can see a game controller only after you press a button on it

Lists connected game controllers, but only after a button press on the controller.

Reveals a controller is plugged in or paired (id string includes vendor and product IDs). Hidden until the user presses a button, so it is not a silent probe.

What it can and can't do

What the user does: You press a button on a connected controller while the page is open

It can

  • List connected controllers, including maker and product codes
  • Use the controller to play a game in the page
  • Tell when a controller connects or disconnects

It cannot

  • See a controller before you press a button on it
  • See controllers when the tab is in the background
  • Learn anything about other devices
  • Silently check; pressing a button is required

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported352014-05-20None
EdgeSupported122015-07-29None
FirefoxSupported292014-04-29None
SafariSupported10.12017-03-27None
Safari on iPhoneSupported10.32017-03-27None
Chrome on AndroidSupported352014-05-20None
Samsung InternetSupported3.02015-04-10None

How a site asks for it

APInavigator.getGamepads(), gamepadconnected event
Permissions policygamepad
Browser compat keysapi.Navigator.getGamepads
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsread fresh on every page load; nothing stored
How to take it backnone needed (no grant)
Inside an iframeReadable from cross-origin iframes too (same values)

Typical flow

  1. Page script reads the value
  2. No prompt is shown

Data you get

Shape: object
How often: static per session

FieldTypeUnitRangePrecision
idstringNonee.g. Xbox 360 Controller (STANDARD GAMEPAD Vendor: 045e Product: 028e)Not listed
buttonslistNoneup to 17 buttonsNot listed
axeslistNoneup to 4 axes, -1 to 1Not listed

Technical limits

  • Needs user input on the pad first
  • Only while the page is focused

The story

What it is

Lists game controllers connected to your device, but only after you press a button on one.

For you

You plug in or pair a controller, then press a button. Only then the page can see it. Nothing shows up before that, so it is not a silent check.

For makers

Games and cloud gaming sites want controller support to feel like a console. The press-a-button rule stops sites from quietly listing devices. The controller name still shows the brand, which is a small fingerprint clue.

Where you see it

TypeExampleApps
gamesA cloud gaming site such as Xbox Cloud Gaming shows controller buttons on screen after you press a button on your Xbox pad.Xbox Cloud Gaming, GeForce NOW
gamesA browser platformer or racing game switches from keyboard hints to PlayStation button icons when it sees a DualSense.Poki
gamesA multiplayer party game in the browser assigns player 1 to 4 as each friend presses a button on their pad.None named
accessibilityA web game supports an adaptive controller so players with limited mobility can join in.None named
mediaA browser media center app lets you browse shows with a gamepad on a living room TV.None named
educationA web robotics simulator lets students drive a virtual robot with a joystick.None named
securityA fingerprinting script records the controller ID string once a user presses a button.None named

Risks

  • Brand and model of controller revealed
  • Only after a button press

What the platform says

  • MDN: Gamepad API. Documents how pages read controllers so web games can feel like console games.

Good uses and abuse

Legitimate uses

  • Browser games

Known abuse

  • Detect gamers

Scores

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

History

  • 2018-01, Chrome: Secure context and focused-page needed; Permissions-Policy gamepad added

Sources

How well checked: Based on official documentation.

On this page