DEV Community

David Garcia
David Garcia

Posted on

๐Ÿ”Ž Do you know the Sensors panel in DevTools?

๐Ÿ”„ How to use it:

  • Open DevTools (F12 or Ctrl+Shift+I in Chrome).
  • Go to the More tools > Sensors tab.

1๏ธโƒฃ Override Geolocation

Simulates the userโ€™s location anywhere in the world.

Example: If youโ€™re developing a location-based app, you can test how it behaves in New York, Tokyo, or Buenos Aires without moving.

2๏ธโƒฃ Simulate Device Orientation

Modifies accelerometer and gyroscope values to test device rotation changes.

Example: If youโ€™re building an augmented reality app or a responsive website, you can check how it behaves when rotating the device.

3๏ธโƒฃ Force Touch Events

Simulates touch interactions on mobile devices.

Example: If youโ€™re optimizing touch gestures (swipes, pinches, long presses), you can test them without a physical device.

4๏ธโƒฃ Emulate an Inactive Sensor

Simulates disabled or inactive sensors, such as proximity detection.

Example: Useful for testing how an app behaves when certain sensors are unavailable on the userโ€™s device.

๐Ÿ‘‰ Have you tried these options in your projects? ๐Ÿš€

โ„น๏ธ More info on Googleโ€™s website:
https://developer.chrome.com/docs/devtools/sensors?hl=en

Top comments (0)