Tactile force-feedback (controller rumble) adds tremendous immersion when crashing a vehicle, firing a weapon, or taking damage in a game. Thanks to the Gamepad HapticActuator API, modern web browsers can trigger physical dual-rumble vibration motors in Xbox, PlayStation, and third-party USB gamepads directly from JavaScript!
However, many players find that rumble never triggers in their browser games. This is usually due to browser permissions, missing driver support, or Bluetooth protocol limitations.
Here is how to verify and enable gamepad haptic vibration in modern browsers.
1. How the HapticActuator API Works
When a game initiates rumble, it calls playEffect on the controller’s vibration actuator:
const gamepad = navigator.getGamepads()[0];
if (gamepad && gamepad.vibrationActuator) {
gamepad.vibrationActuator.playEffect('dual-rumble', {
startDelay: 0,
duration: 400, // Duration in milliseconds
weakMagnitude: 0.8, // High-frequency small motor
strongMagnitude: 0.5 // Low-frequency heavy motor
});
}
2. Platform Requirements for Browser Haptics
- Windows: Fully supported in Google Chrome, Microsoft Edge, and Opera using standard XInput (Xbox) and DirectInput controllers.
- macOS: Supported on macOS Monterey or newer for officially paired Xbox Wireless and DualSense controllers.
- Connection Type: On Windows, Xbox controller vibration works natively over wired USB and the official Xbox Wireless Adapter, but some generic Bluetooth stacks block force-feedback commands. Connecting via USB cable guarantees full dual-rumble support.
Related Guides & Documentation
- Category Hub: Browse all guides in Controls, Latency & Audio Fixes
- Related Guide: Understanding Browser Input Buffering: Why Frame Queueing Causes Perceived Controller Lag — How the Chromium compositor frame swapchain queues frames and how to minimize input lag by aligning polling with requestAnimationFrame.
- Related Guide: AudioWorklet vs Legacy ScriptProcessorNode: Why Web Audio Clicks and Pops on Budget CPUs — How the Web Audio API renders real-time sound, why legacy ScriptProcessorNode clicks on busy CPU threads, and how AudioWorklet offloads synthesis.
- Related Guide: Troubleshooting Audio Crackling and Sound Delay in Browser Games — A guide to understanding audio buffer underruns, sample rate mismatches, and latency in web games using the Web Audio API.