Pointer lockLimited availability
Provides access to raw mouse movement by locking the target of mouse events to a single element and hiding the mouse cursor.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–36Not supported
37+Supportedsince Aug 26, 2014
Current: 155Edge
12–12Not supported
13+Supportedsince Nov 12, 2015
Current: 154Firefox
1–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27MobileChrome Android
18–143Not supported
144+Supportedsince Jan 13, 2026
Current: 155Firefox Android
4–49Not supported
50+Supportedsince Nov 15, 2016
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: exitPointerLock.
Feature detection
JS · check before using
if ("Document" in globalThis && "exitPointerLock" in Document.prototype) {
// Document.exitPointerLock is available
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (5). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Document.exitPointerLock | 37 | 13 | 50 | 10.1 | 144 | 50 | ✕ |
| Document.pointerLockElement | 37 | 13 | 50 | 10.1 | 144 | 50 | ✕ |
| Document.pointerlockchange_event | 36 | 13 | 50 | 10.1 | 144 | 50 | ✕ |
| Document.pointerlockerror_event | 36 | 13 | 50 | 10.1 | 144 | 50 | ✕ |
| Element.requestPointerLock | 37 | 13 | 50 | 10.1 | 144 | 50 | ✕ |