Enabling Dual-Rumble Haptic Vibration Feedback via the Gamepad HapticActuator API

How modern browsers communicate with controller rumble motors and how to configure browser permissions for force-feedback in HTML5 games.

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.

Share this guide
DV

About the Author: Devin Vance

Devin Vance writes technical guides and performance benchmarks at TabGamer, covering browser graphics, WebGL flags, low-spec laptop optimization, and retro WebAssembly emulation.