safari

How do I use SFSafariViewController with SwiftUI?

♀尐吖头ヾ 提交于 2020-07-05 03:51:55
问题 I'm trying to present a SFSafariViewController from a NavigationButton but I'm not sure how to do that with SwiftUI. In UIKit, I would just do: let vc = SFSafariViewController(url: URL(string: "https://google.com"), entersReaderIfAvailable: true) vc.delegate = self present(vc, animated: true) 回答1: Supplemental to Matteo Pacini post, .presentation(Modal()) was removed by iOS 13's release. This code should work (tested in Xcode 11.3, iOS 13.0 - 13.3): import SwiftUI import SafariServices struct

How to NOT handle some Universal Links programmatically?

邮差的信 提交于 2020-06-28 04:06:34
问题 My iOS application handles universal links to redirect safari users to my app. So far everything is working great, if a user tap a link to my web site from Google my app is opening instead of my web site like this: from safari https://my-web-site.com -> my-app But my app doesn't implement certains features that my web site does, so I would like to programmatically reject some URLs and let my users on safari instead of redirecting him in my app, like this: from safari https://my-web-site.com -

Express session is empty in Safari

南楼画角 提交于 2020-06-27 11:03:39
问题 I'm building a Node.js application with express. I use express-session for sessions. The data I store in a session is available in IE, Chrome and Firefox. But in Safari the session is empty all the time. So when I do console.log(req.session) it prints: Session { cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true, secure: true }, userHasCheckCorrect: true } This are my settings in server.js app.use(session({ secret: process.env.SESSION_SECRET, resave: false,

Express session is empty in Safari

社会主义新天地 提交于 2020-06-27 11:02:21
问题 I'm building a Node.js application with express. I use express-session for sessions. The data I store in a session is available in IE, Chrome and Firefox. But in Safari the session is empty all the time. So when I do console.log(req.session) it prints: Session { cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true, secure: true }, userHasCheckCorrect: true } This are my settings in server.js app.use(session({ secret: process.env.SESSION_SECRET, resave: false,

Disable double tap zoom on Safari iOS 13 +

跟風遠走 提交于 2020-06-27 06:18:24
问题 How can we disable "double tap to zoom" on Safari iOS 13+ mobile? Sometimes it zooms, sometimes not. i feel it may only work on specific HTML-elements. And i read that "double tap to zoom" should be disabled on iOS 13 by default and only pinch-zoom should work, but that's not the case. 回答1: You can add the below meta tag to stop zooming on ios devices. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"/> a css fix: body{ touch-action:

Elements disappear when scrolling in Safari - -webkit-transform fix only works the first time

无人久伴 提交于 2020-06-27 06:06:51
问题 This only happens in iPhone-sized Safari. I am aware that the "usual fix" for this issue is to apply -webkit-transform: translate3d(0,0,0); (per Serge's answer here) and that does fix the issue, but only once. The issue occurs with a "drawer" menu that opens when the user clicks a menu button. The menu will show normally, but when it is touched/scrolled by a finger, the whole menu disappears from the page. Applying -webkit-transform: translate3d(0,0,0) fixes the issue, but only the first time

Safari Web Inspector network throttling

99封情书 提交于 2020-06-25 07:23:19
问题 I'm currently remote-debugging a website on my iPhone using Safari v8 and need to simulate different network speeds. The Chrome Developer Tools have the functionality to throttle the network connection (simulate 3G, wifi etc.) or even to completely switch it off. Does the Safari Web Inspector have similar functionality? At the moment I'm getting around it by just switching off my wifi as I just need to test no network for now, but might need the functionality in the future. 回答1: There is

How do I detect if a user has Mac OS high contrast accessibility settings enabled?

为君一笑 提交于 2020-06-25 03:53:15
问题 I have a React/TypeScript project, and I am trying to detect if a user has any of Mac OS's high contrast accessibility settings enabled: Invert colors, Use grayscale, Differentiate without color, Increase contrast, or an increased Display contrast setting. I want to detect these using JavaScript/TypeScript. So far, I can detect only Invert colors. How do I detect if a user has any of the other Mac OS accessibility settings enabled? More information: The prefers contrast media query is not yet

How do I detect if a user has Mac OS high contrast accessibility settings enabled?

谁都会走 提交于 2020-06-25 03:53:12
问题 I have a React/TypeScript project, and I am trying to detect if a user has any of Mac OS's high contrast accessibility settings enabled: Invert colors, Use grayscale, Differentiate without color, Increase contrast, or an increased Display contrast setting. I want to detect these using JavaScript/TypeScript. So far, I can detect only Invert colors. How do I detect if a user has any of the other Mac OS accessibility settings enabled? More information: The prefers contrast media query is not yet

How to use WebShareAPI preceded by an AJAX call in Safari?

岁酱吖の 提交于 2020-06-25 03:25:33
问题 When users click the share button on our paywalled site, we generate a token via an async call that allows the people clicking on the share link to bypass the paywall. I've added support for Web Share API first calling the token before triggering navigator.share - along these lines: fetchCallForLink() .then((url) => { navigator.share({ title: 'Test Title', url, }); This is working fine on Chrome / Android which supports Web Share. However on Safari, I am getting a not allowed error. The