ReadonlyaudioHardware audio levels and optional browser headphone playback/microphone capture.
Firmware metadata reported by the connected controller, or null when unavailable.
Sony certificate and random-challenge signature check over USB or Bluetooth.
false means both signatures verified, true means a signature failed.
null means unknown (pending, unsupported, I/O failure or timeout).
Background completion emits clonecheck after this field is updated.
Copied authentic controller keys cannot be distinguished by this check.
OptionallastRaw contents of the last HID Report sent by the controller.
OptionallastRaw contents of the last HID Report sent to the controller.
Allows lightbar control
Allows rumble control
Current controller state
Internal WebHID device
Whether background authentication is running for the current controller.
False before starting, after completion (including an unknown result),
and immediately after cancellation. Already false in clonecheck listeners.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsOptionaloptions: boolean | AddEventListenerOptionsRequests access to a controller and opens its WebHID session.
This function must be called in the context of user interaction
(i.e in a click event handler), otherwise it might not work.
Firmware reading is bounded by one second; authentication runs in the
background and does not delay connection or the connect event.
true when the controller is connected, or false when device selection is cancelled.
Stops rumble and closes the current WebHID session without revoking device
permission. Pending output that is waiting for transport detection rejects
with an AbortError.
If the browser fails to close a device that remains open, the active session is restored and the error is rethrown so disconnection can be retried.
Reads DualShock 4 feature report 0xA3, updates firmwareInfo, and starts background authentication without waiting for its result.
Both USB and Bluetooth controllers use this report. The firmware request
times out after one second. A separate authentication exchange using
0xF0/0xF2/0xF1 verifies the Sony certificate and challenge signature, with
a total 30-second deadline. Concurrent checks share one exchange. While
pending, isCloneChecking is true and isClone is null; completion updates it and emits
clonecheck. Subscribe before connecting or refreshing to observe results.
Unsupported, timed out, or malformed firmware reports return null;
authentication failures do not prevent compatible controllers connecting.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsOptionaloptions: boolean | EventListenerOptionsSends the local rumble, lightbar and configured hardware volumes to the controller.
This function is called automatically in most cases. Output requested before the first supported input report is combined and sent once the interface is known.
Main class.