by Sephr · 12y ago · 0 comments
The offending code (from http://gameaboutsquares.com/game.c.js, beautified):
(function($) {
try {
document.createEvent("TouchEvent");
return;
} catch (f) {}
var eventMap = {
mousedown : "touchstart",
mouseup : "touchend",
mousemove : "touchmove"
};
// mouse handling code follows
Never do this! Remove the entire try-catch block. There is absolutely no reason for you to be limiting touch-capable users to touch-only.We're now treating the touch-only versions as optimized for specific platforms. For example, we have a mobile version that is optimized for, and only displays on, Android and iOS. Going forward, we may explore a pointer event polyfill to improve support for less common touch devices.