Microsoft Edge オリジン試用版開発者コンソール

HapticsDevice API

Enable the rich HapticsDevice API on PointerEvents for devices that support it.

Available from Microsoft Edge to

End Date 2021/12/31


cross-web-community conversations such an effort would require, this was not placed under the scope of this proposal.

Alternative Solutions

Throughout the design of this proposal, several other approaches were considered:

getSupportedWaveforms() Versus Standardized, Predefined Waveforms

An earlier version of this proposal suggested the creation of a getSupportedWaveforms() function which would let developers query for predefined waveforms associated with a specific pointer/haptic device. The thought here was that OEMs may want to implement vendor-specific waveforms that may not be present on other OEM devices. While this sentiment may exist, exposing getSupportedWaveforms() would introduce fingerprinting concerns as the unique set of haptic waveforms supported by a certain haptics controller could be used as bits of entropy to uniquely identify a user. While various mechanisms could be implemented to reduce this risk, such as permission prompts or gating the ability to query for supported waveforms behind user interaction, the idea of a standardized set of pre-defined waveforms combined with a mechanism for developers to access vendor-specific waveforms is a more seamless experience for the end user. The play(...) function with HapticsPattern fills the gap of allowing a developer to implement other waveforms not provided by the pre-defined or standardized waveforms.

Open Questions

  1. Should this API expose a mechanism for informing developers whether the waveform they attempted to fire played successfully?
  2. To align with native platforms, should this API expose a mechanism for developers to query whether certain haptic capabilities (intensity, play count, repeat, etc.) are supported by a given pointer/haptic device?
  3. What venues already exist for the standardization of haptic constants? Microsoft haptic documentation refers to the HID Usage Tables that defines some waveforms as part of USB-IF's HID related specifications.
  4. What happens when play() is called while a waveform is currently playing?