Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.

General Documentation

Post

Replies

Boosts

Views

Activity

Animated AVIF is rendered slowly on Safari
Animated AVIF is rendered slowly on Safari Tested with MacBook pro (16" 2019) and Safari (Version 17.0 - 19616.1.27.211.1) and also on several iPhone models (14, 15 Pro) (over BrowserStack) When using macBook pro (16" 2019) with Chrome (Version 120.0.6099.129) it is rendered OK example for 720p@25FPS: https://res.cloudinary.com/yaronshmueli/image/upload/cases/animated_AVIF_Apple/world_flight_fast_decode_tile_clmn_btiolg.avif
1
2
811
Dec ’23
WebXR Mixed Reality Supported in Safari Vision OS?
I understand that fully immersive experiences, Quicklook using USDZ, and the newly adopted element tag for 3D objects are all supported in WebXR in Safari on Vision OS. What about Mixed Reality in WebXR? Meaning augmented reality experiences seen using passthrough on the apple vision pro where you can see your environment in combination with the webXR experience. (not fully immersive) Can you run full webXR experiences in passthrough mode? Or just view 3D models.
4
2
914
Dec ’23
WebSocket connection failed while sending 10KB binary data
Hello, I'm creating a WebSocket connection to my server from the safari browser via console tab like below. let socket = new WebSocket('wss://localhost:1200/WS_TEST?client=123&session=1234'); socket.onopen = function (event) { console.log('WebSocket connection opened:', event); }; socket.onmessage = function (event) { console.log('Received buffer', event.data); }; Once the connection established, The server sends multiple data which includes text and binary data. When the server sends binary data more than 10KB after sending text data in the same socket, the WebSocket connection is getting failed. EX: Frame Type(Text): "Hi" Frame Type(Binary): just binary frame of size 11KB When the server send the binary data alone, the connection is not affected even the size is more than 100KBs EX: Frame Type(Binary): just binary frame of size 100KB
1
0
333
Jan ’24
Add to apple calendar is not working react PWA app on iPhone
Add to apple calendar is not working react PWA app on iPhone I have developed react PWA app reactjs - v16.14.0 and testing in my iphone13. I have used **npm library ** which opens google,outlook, apple calender event properly on android device, on IOS google and outlook works fine but add to apple calendar event doesnt not show any popup or not showing any error. I have reported one issue on this library forum but they have mentioned that Apple blocks the dynamic generation of ics files I am looking for resolution for this. Let me know proper way to add event in apple calender considering javascript library. [Edited by Moderator]
0
0
848
Jan ’24
Safari not loading web fonts in web worker due to same-origin fetch mode
I am developing an app that uses a Web Worker to render on a canvas, using transferControlToOffscreen(). I need to load web fonts into the canvas for rendering some text, but they are not loading in Safari (testing on Mac). I get the error : Cannot load https://fonts.gstatic.com/s/zillaslab/v11/dFa5ZfeM_74wlPZtksIFYuUe6HOpW3pwfa0.woff2. Failed to load resource: Cross origin requests are not allowed when using same-origin fetch mode. This works fine in Chrome and Firefox. The fonts return the "Access-Control-Allow-Origin" correctly, but in Safari the call isn't even made in order to check the access-control. Is there a way to get Safari to make these requests and honor the access-control returned in the header for the font? If not, is there a suggested work around in order to load web-fonts in a Worker context?
1
0
577
Jan ’24
Need Help with Error message on Visual Studio Code
Beginning to Learn C++ in school, Just trying to figure out why my program version is saying this? I am a student in school and am learning Visual Studio Code because that's the only way to use C++ anyways I put in a basic code and I'm getting this error message. I have included my code and then the error response. Can anyone tell me what went wrong? I feel like it should be all legit... #include using namespace std; int main() { cout << "welcome to C++!"; return 0; } Error Response Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2
0
336
Jan ’24
How to reset the CookieAcceptPolicy setting for NSHTTPCookieStorage.
I made a change to the CookieAcceptPolicy in NSHTTPCookieStorage in my app: [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyNever]; When I use the following code to restore its settings: [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain]; WKWebView still does not store cookies. I found that in iOS 17, the cookie policy for WKWebView can be enabled through the following configuration: [[[WKWebsiteDataStore defaultDataStore] httpCookieStore] setCookiePolicy:WKCookiePolicyAllow completionHandler:^{}]; But how can this be done in versions prior to iOS 17?
0
0
264
Jan ’24
Using Apple Push Notifications Console with Safari Web Push?
I'm using standard Safari Web Push, but my notifications aren't coming through. I'm trying to debug this. Is it possible to use the Apple Push Notifications Console to debug/analyze Safari Web Push deliverability? I can't figure out how to use it for web push. When I login and try to use the Push Notification Console, it asks me to choose an "app." But for standard Safari 16+ Web Push, there is no "app," no "Website Push ID", etc. that I register with Apple. So how can I use the Push Notification Console for this? Apple's documentation does strongly imply that it should work. Sending web push notifications in web apps and browsers: To resolve an error, address the issue and resend your push notification request. For more information about the factors that impact the delivery of a push notification, see Viewing the status of push notifications using Metrics and APNs. And that page is all about the Push Notification Console. So it must be possible somehow, right?
0
0
579
Jan ’24
about fonts
I'm developing a website. When I write font-family: system-ui,PingFang SC in css, I understand that there is no risk of infringement. Can you confirm it for me? At the same time, what I'm not sure about is if I take screenshots on my website, are there any risks in terms of copyright infringement? Looking forward to your reply
1
0
344
Jan ’24
Strange reload behavior, WKWebView reloads with returnCacheDataElseLoad after background
Hi, in our app we have a WKWebView with complex web content that is loaded with cachePolicy: .reloadIgnoringLocalCacheData. If the app is in the background for several hours and returns in the foreground we noticed that the system reloads the webpage, but it does so with a cachePoliy returnCacheDataElseLoad. This could break the app if older cache content is present. To reproduce start an app in the simulator (tested with iOS 17.2), put it in the background and via activity monitor stop the processes com.apple.Webkit.WebContent com.apple.Webkit.networking After foreground the reload will happen. Two questions: why is this reload happening after some hours in the background? We haven't seen any crash reports related to this. It mostly happens on one of our test devices (iphone13 with iOS17.2.1). why is the webview reloading with a modified cachePolicy (returnCacheDataElseLoad)? Our temporary fix is to detect this case in "webView:decidePolicyFor navigationAction decisionHandler", cancel the request and reload with modified cachePolicy. Any ideas? Thanks, Heiko Sample code: class ViewController: UIViewController, WKNavigationDelegate, WKUIDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let config = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: config) webView.uiDelegate = self webView.navigationDelegate = self view.addSubview(webView) let myRequest = URLRequest(url: URL(string: "https://www.apple.com")!, cachePolicy: .reloadIgnoringLocalCacheData) print("request \(myRequest)") webView.load(myRequest) } func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { print("start loading \(String(describing: navigationAction.request.url)), cache:\(navigationAction.request.cachePolicy)") decisionHandler(.allow) } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() let fullscreen = CGRect.init(x: 0, y: 0, width: view.frame.size.width, height: view.frame.size.height) webView.frame = fullscreen } }
2
1
899
Jan ’24
revert-layer within inline styles
Although CanIUse reports only 3% global support for the revert-layer keyword, I've noticed that it seems to work pretty consistently within inline styles (i.e. the style attribute). This got me thinking (hoping) that maybe browser support for revert-layer specifically within inline styles may be much better than reported. However, it's difficult to find any data since I suppose my use case is somewhat uncommon. Can anyone comment on the state of Safari's support for revert-layer specifically within inline styles? I would be extremely grateful for any light you can shed on this.
0
0
493
Jan ’24
Possible issues with Websockets in Safari 17?
Hi, we have a WebRTC application web application in which our video freezes in Safari 17 (no other browsers or earlier Safari). Our application also uses js Websockets as part of signalling protocols. We seem to get video freezing when we establish and send data over one of these websockets. We have seen various posts online about websocket fragmentation bugs causing ESP (?) issues with the new NSURLSession Websocket implementation, but don't see any resolution (nor how in Safari 17 if we can switch back to a legacy websocket implementation). Additionally, we don't appear to have problems with one of our APIs, which differs in the 'problematic' one in that it uses a Websocket with a 'binaryType' defaulted to 'Blob', whereas our troublesome one sets the binary type to 'arraybuffer'. I saw that the Safari 17 release notes mentions 'Fixed WebSocket’s binaryType setter to not throw. (109192086)' but, again, I can't find any further detail and whether this means that there are still issues with Safari 17 Websocket binaryType? Obviously, we will try changing our implementation to use 'Blob' and see if this makes a difference, but it would be useful to know if anyone has had any similar issues with Safari 17????? Kind regards, Mike
1
1
795
Jan ’24
Safari keeps logging me out of websites
It started happening about 6 months ago, I'm using the latest Safari Version 17.2.1 (19617.1.17.11.12) Below are my privacy settings I've tried creating a new user on the Mac and using that, and still does it. I've tried resetting all developer settings on the browser and still does it. It's quite frustrating as I keep losing my work, specially on Shopify, I hit save and the browser is logged out. I need a solution for this, there are posts here from years ago of people with similar issue and no solution from Apple.
3
1
916
Jan ’24
navigator.mediaDevices.getUserMedia OverconstrainedError on Safari in IOS17
When javaScript calls to navigator.mediaDevices.getUserMedia using {video: true, audio: true } constraints, throws an error: error: OverconstrainedError constraint: "" message: "Invalid constraint" name: "OverconstrainedError" Same result when constraints has video: true and audio: false You can test it easily opening the webRTC github samples: https://webrtc.github.io/samples/src/content/devices/multi/ https://webrtc.github.io/samples/src/content/getusermedia/gum/ This works fine on IOS16
0
0
710
Jan ’24
"Google pay button icon" not visible in specific iOS versions
Hi, The below code is used for loading GPay icon dynamically from Google in "WKWebView". The same code works for later versions of IOS like 16.4, but issue happens in 16.1 ,16.2 and 16.3 versions. while loading this code from IOS 16.3 the icon (Gpay icon) is completely black, looks like it's not loaded properly. Please assist us on what can be the issue, and how we can proceed to solve the issue. Not working Working
0
0
627
Jan ’24
How can I add "WebKit uploads"?
0x60700003ab00 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit uploads' for process with PID=56268, error: Error Domain=RBSServiceErrorDomain Code=1 "originator doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=originator doesn't have entitlement com.apple.runningboard.assertions.webkit} Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "originator doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=originator doesn't have entitlement com.apple.runningboard.assertions.webkit}> The above error occurs. What should I do?
0
0
379
Jan ’24
Safari Web Extension browser.tabs.captureVisibleTab() is not capturing the image correctly
On Safari Mobile and iOS version 16 or 17, while scrolling the webpage, the function browser.tabs.captureVisibleTab() is not returning the expected screen image. The image is cropped from the top. The probable reason for the same is the collapsible Address Bar. The below attached image is the iPad mini (6th generation ) Simulator OS Version:17.0 simulator The below attached image is created by browser.tabs.captureVisibleTab() I tested it on iPad mini (6th generation ) Simulator OS Version:17.0 and iPad (8th generation) - iPadOS Version 16.2.
1
0
759
Jan ’24
touch events do not work in ipad air and pro
what happened? i never noticed it until i decided to use ipad air and pro as option in chrome dev console mobile view as well as ios simulator. it works ok in the ipad mini. touch events do not get triggered. instead, the scroll seems to overlap these. EDIT: Solved. please see comment below. While it works ok in ipad pro devices now, I still wish this could work out in chrome's dev console ipad pro view. the behavior is different with click events. instead of mouse down, it starts with mouse move. what gives? this only happens in ipad air and pro view in the device toolbar in dev console.
1
0
670
Jan ’24