iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Touchscreen detection broken in Chrome 70 (desktop) #1292

Open khabraken opened 6 years ago

khabraken commented 6 years ago

Chrome 70 has disabled the ontouch* APIs on desktop, see https://www.chromestatus.com/feature/4764225348042752

This prevents touchscreen detection (and subsequently functionality) in the leaflet source: https://github.com/iitc-project/ingress-intel-total-conversion/blob/0fabfb68943fc833153d89454220fa638a8b9fb6/external/leaflet-src.js#L536

As per the first link, the appropriate fix should probably be "site should use navigator.maxTouchPoints for touchscreen detection, and Windows.TouchEvent for TouchEvent feature detection".

Alternatively, the 'pointer' variable: https://github.com/iitc-project/ingress-intel-total-conversion/blob/0fabfb68943fc833153d89454220fa638a8b9fb6/external/leaflet-src.js#L523 should be updated to match what the most recent leaflet source sets it to: https://github.com/Leaflet/Leaflet/blob/9fda888df2791ca0df6f182a9d91d393ee49034c/src/core/Browser.js#L95 (navigator.pointerEnabled was deprecated ages ago and was never standard, thus 'pointer' always ends up false)

Further reading: https://bugs.chromium.org/p/chromium/issues/detail?id=897906