Skip to content

mobile-config-prefs.js: enable TouchEvents API for mobile detection

jane400 requested to merge jane400/mobile-config-firefox:touch-events into master

This MR was created using the GitLab Web UI, but it's trivial.

https://developer.mozilla.org/en-US/docs/Web/API/Touch_events

Touch events are typically available on devices with a touch screen, but many browsers make the touch events API unavailable on all desktop devices, even those with touch screens.

The reason for this is that some websites use the availability of parts of the touch events API as an indicator that the browser is running on a mobile device. If the touch events API is available, these websites will assume a mobile device and serve mobile-optimized content. This may then provide a poor experience for users of desktop devices that have touch screens.

This fixes e.g. the player and layout of Invidious by letting this isMobile() check return true.

Arguments against this change might evolve around privacy concerns, as it may increase fingerprinting capabilities, but might also decrease them, as mobile-config-firefox might be the odd one out currently, as it doesn't feature this API.

Merge request reports