javascripthtmlgoogle-chromemobile

How to simulate touch gestures in browser, preferably chrome?


The purpose of this question is to learn how to test JS event listeners for touch events on mobile devices.


Solution

  • While on Chrome, press F12 to toggle Developer Mode.

    Then, on the top-left of the developer partial, you will see a small icon saying "Toggle Device Mode" (Ctrl/CMD + Shift + M)

    enter image description here

    Then, you can switch between devices at the top.

    enter image description here

    This will mimic touch gestures made by a real device.