mobile-safari

Javascript touch event: distinguishing finger vs. Apple Pencil

拜拜、爱过 提交于 2019-12-19 02:45:08
问题 In Mobile Safari, is there any way to distinguish whether a touch event is generated by finger or Apple Pencil? 回答1: The TouchList object of a touch event contains detailed information about the touch’s individual points. Among the many properties touchType is probably the most interesting for you as it contains either stylus (Apple Pencil) or direct (finger). var body = document.getElementByTagName('body'); body.addEventListener('touchstart', function(evt){ // should be either "stylus" or

Open installed PWA from external url

空扰寡人 提交于 2019-12-18 18:55:07
问题 Is there any method to open website (PWA) urls in the installed PWA in iOS- Safari? Use case: I'm sending email links to login in my PWA, how can I make this url's open directly with the installed PWA instead of the browser? 回答1: If you are using Chrome in Android or any of the desktop OS, that would be the default behavior. Check on "Android intent filter" in this link. This feature is not supported in iOS yet for PWA apps(created using Safari- the only option for iOS as of June-2018).See

Request.Browser.IsMobileDevice not working with iPadAir2 and iOS 13.0.1

六月ゝ 毕业季﹏ 提交于 2019-12-18 17:30:10
问题 I am able to detect iPadAir2 device running on iOS 11.4 using Request.Browser.IsMobileDevice and it gives me UserAgent information saying its an iPad: When I do same for iPadAir2 running on iOS 13.0.1 its not giving me iPad keyword anymore: how do I detect its an ipad and ruuning a safari browser? I need this to detect iPad in Razor .chtml page so I can show different Menu for my website. I found this solution from here How to detect device name in Safari on iOS 13 while it doesn't show the

PWA - cached video will not play in Mobile Safari (11.4)

﹥>﹥吖頭↗ 提交于 2019-12-18 17:25:13
问题 I'm struggling to create a simple POC for iOS PWA with a small video. https://test-service-worker.azurewebsites.net/ I have simple service worker registration and I cache a small (700kB) video. When I'm online the page works just fine. When I turn on airplane mode and go offline, the page is still reloaded but video will not play. This POC is based on Google Chrome example https://googlechrome.github.io/samples/service-worker/prefetch-video/ The video from this example will not work in iOS

Fixed persistent header and scroll to focussed input fields

不想你离开。 提交于 2019-12-18 14:10:27
问题 QUESTION: Based on the given examples for homescreen web apps in iOS7 Safari, how can I achieve both a fixed persistent header that never scrolls out of view, and form input fields that scroll into view when tapped? The two examples have one difference, one has height=device-height in the viewport, the other doesn't. Without device-height <meta id="viewport" name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1" /> Demo: http://run.plnkr.co/plunks/SU8Csk/ Edit Link: http

How to hide Safari Mobile browser bottom button bar in iPhone?

孤人 提交于 2019-12-18 13:14:04
问题 Following is head section: <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="apple-touch-fullscreen" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <link rel="apple-touch-icon" href="/custom_icon.png"/> <link rel="apple-touch-startup-image" href="/startup.png"> <script src="http://www.google.com/jsapi"></script>

How to Create “Add to Calendar” Link on Web Page for iPhone

末鹿安然 提交于 2019-12-18 12:56:24
问题 Many calendaring programs (Outlook, iCal) support vCal for downloading event information and adding it to your calendar. Others can use the vCalendar microformat to extract data. Neither of these, however, seems to be supported on the iPhone. Is there any functional equivalent that will allow me to list event information on a page and have a website visitor add the event to her calendar with a single click? Since Mobile Safari makes it super-easy to extract emails and phone numbers from web

Is there a bug in the new iOS 7.1 minimal-ui viewport setting?

跟風遠走 提交于 2019-12-18 12:32:49
问题 The new "minimal ui" setting in iOS 7.1 is great for landscape websites. My web app uses a fullscreen, absolute positioned div for its content, to give it an app-like feeling. But Safari seems to add just the height of the URL bar at the bottom. I have tried this on different iPhones, same result... Here is how it looks after the pages loaded: Is this a bug or something I am doing wrong or missing? Click for example (view on iPhone with iOS >= 7.1) 回答1: I had same problem with iPhone5+ios7.1

Mp4 video in html5 video tag not playing in mobile chrome and mobile safari

自作多情 提交于 2019-12-18 12:24:26
问题 I have this code to play a video in a html5 page: <video autoplay loop id="bgvid"> <source src="video-background.mp4" poster="/poster.png" type="video/mp4"> </video> The problem is that it does not work in mobile chrome (Android Phone) and either in mobile safari (iPhone). But it works in "every" browser (tested with Safari, Chrome, Firefox) in desktop and also on mobile firefox (Android Phone). How can I overcame this problem? Edit: Added this code: var myVideo = document.getElementById(

Is it possible to hide the address bar in iOS 7 Safari? [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-18 10:34:07
问题 This question already has answers here : Impossible to hide navigation bars in Safari iOS 7 for iPhone/iPod touch (8 answers) Closed 6 years ago . Is it possible to hide the address bar in iOS 7? I am currently using the below to do this in iOS 6 but I just updated xCode and tested in iPhone Sim and iOS 7 Safari is not responding to this. js: window.addEventListener("load",function() { // Set a timeout... setTimeout(function(){ // Hide the address bar! window.scrollTo(0, 1); }, 0); }); 回答1: