Legacy Touch Events API is now disabled on desktop

Published: | Categories: DOM

Description

Firefox 67 has followed Chrome 70 to disable the legacy Touch Events API on desktop platforms, which had been available since Firefox 52, because websites keep misusing the API for mobile detection, treating Firefox as a mobile browser on desktop and laptop computers with a touchscreen.

These are no longer available on desktop:

  • createTouch, createTouchList, createEvent('TouchEvent') methods on document
  • ontouchstart, ontouchmove, ontouchend, ontouchcancel properties on window, document, element

The Touch Events API itself is still available on computers with a touchscreen, including:

  • Touch, TouchEvent, TouchList interfaces on window
  • touchstart, touchmove, touchend, touchcancel event handlers that can be used with addEventListener()

Note that the createTouch and createTouchList methods have been deprecated and will be completely removed from Firefox in the near future.

References