Can’t prevent `touchmove` from scrolling window on iOS

I recently ran into this same problem. You’ll need to pass { passive: false } when registering the touchmove event listener. e.g. document.addEventListener(‘touchmove’, function(e) { e.preventDefault(); }, { passive: false }); This is because document touch event listeners are now passive by default in Safari 11.1, which is bundled with iOS 11.3. This change is … Read more

How to detect if web app running standalone on Chrome mobile

This answer comes with a huge delay, but I post it here just for other people who are struggling to find a solution. Recently Google has implemented the CSS conditional display-mode: standalone, so there are two possible ways to detect if an app is running standalone: Using CSS: @media all and (display-mode: standalone) { /* … Read more

remove grey background on link clicked in ios safari / chrome / firefox

Webkit has a specific style property for that: -webkit-tap-highlight-color. Copied from: http://davidwalsh.name/mobile-highlight-color— /* light blue at 80% opacity */ html { -webkit-tap-highlight-color: rgba(201, 224, 253, 0.8); } /* change it for a div that has a similar background-color to the light blue tap color */ .blueDiv { -webkit-tap-highlight-color: rgba(251, 185, 250, 0.9); } If you … Read more

UIWebView and Safari comparison

Does UIWebView use the same JavaScript engine as Mobile Safari? UIWebView does not have the Nitro Javascript engine, so it executes JS slower than Mobile Safari. So it’s not the same. Also, does UIWebView support all HTML5 features like Mobile Safari does? I am specifically concerned about Web SQL and Web Workers Not sure about … Read more

Javascript date parsing on Iphone

Not all browsers support the same date formats. The best approach is to split the string on the separator characters (-,   and 🙂 instead, and pass each of the resulting array items to the Date constructor: var arr = “2010-03-15 10:30:00”.split(/[- :]/), date = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]); console.log(date); //-> Mon … Read more

Available iPhone Web Application JavaScript UI Library/Frameworks

Old question, but still relevant. Sencha (the new name of the company behind ExtJs) just released the mobile app platform Sencha Tounch for iPhone, iPod, iPad and Android: http://www.sencha.com/products/touch/ Blog post that explains the difference between jQTouch and Sencha Touch: http://9-bits.com/post/723711597/jqtouch-and-sencha-touch Update: John Resig recently announced that the jQuery team is working on a mobile … Read more