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

WKWebView sometimes lose cookies after the app returns from suspension
I embedded a WKWebView in my SwiftUI app, and loaded a list of HTTPCookie into a WKWebViewConfiguration object: var wkWebViewConfiguration = WKWebViewConfiguration() let cookies: [HTTPCookie] = ... // logic that creates a list of HTTPCookie for cookie in cookies { wkWebViewConfiguration.websiteDataStore.httpCookieStore.setCookie(cookie) } This logic works but when the app returns to the foreground from a long suspension (more than an hour), sometimes the web view reloads the URL but the cookies are gone. I suspect the web content process is terminated and add a logic to reload the URL and the cookies on process termination: // WKNavigationDelegate method func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { // reload the URL and cookies here } but the issue still persist, could there be any other reasons that the cookies are lost or is my above solution not sufficient to handle web content process termination? This issue is quite random to me and there is no deterministic way to reproduce it.
5
1
2.2k
Feb ’24
Disable iOS 17 Facetime Reactions
Hello, is it somehow possible to disable the FaceTime Reactions by getUserMedia constraints (for example) by JavaScript code? I need just to force to disable this feature by JavaScript for my web tool. I am happy about any solution (even if it is done by HTML property). Greetings
0
0
469
Feb ’24
Have you ever seen an issue like this in ios 16.0.2 wkwebview?
[ProcessSwapping] 0x12c002b70 - [pageProxyID=19, webPageID=35, PID=772, navigationID=6] ProvisionalPageProxy::didFailProvisionalLoadForFrame: frameID=3 2024-02-07 11:31:57.548906+0900 [763:23170] [Process] 0x10d117018 - [pageProxyID=19, webPageID=20, PID=769] WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, isMainFrame=1, domain=, code=0, isMainFrame=1 2024-02-07 11:31:57.553241+0900 [763:23933] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> 2024-02-07 11:31:57.553341+0900 [763:23933] [ProcessSuspension] 0x12b01c2a0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=772, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} 2024-02-07 11:31:57.554500+0900 [763:24086] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 2024-02-07 11:31:57.554574+0900 [763:24086] [ProcessSuspension] 0x12b01c3c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=772, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} I got an error like this, but it's only happening in iOS 16.0.2 and it's working fine in iOS 16.6 and later versions. I've never seen an error before, so I don't know how to solve it. The background fetch is turned on in the background mode of the capabilities. If you have any experience troubleshooting the above issue, please help me.
0
0
785
Feb ’24
JavaScript Core Optimization on Mobile?
Years ago, JSCore on non-macOS disabled JIT, leading to much worse performance than could possibly be achieved with JIT on. Has anything changed recently to permit greater optimizations for JSCore on mobile platforms? (iPadOS, visionOS). My guess is ”no” since the docs still llist only macOS under the MAP_JIT flag, but as far as I know, Apple could still choose to enable JSCore optimizations behind the scenes if this option were available to developers.
4
0
960
Feb ’24
SFSafariViewController Download UX - Divergent Behavior
I've been conducting tests on various iOS apps to identify those that disrupt website downloads when using in-app browsers. During my testing of Gmail, I observed that clicking on Safari within the app actually leads to what seems to be SFSafariViewController. However, the downloading experience within this view is notably cumbersome. To save an image, users must first select 'More...' then scroll to find and select 'Save image'. This behavior is unexpected when users anticipate accessing the full Safari browser. What are the reasons behind the differing UI/UX of SFSafariViewController and Safari?
0
0
326
Feb ’24
Safari and Safari Technology Preview completely broken after upgrading from Ventura 13.6.5 to Sonoma‌ 14.4
Hi, three days ago I made the mistake of upgrading to Sonoma 14.4. After the upgrade, I tried to open Safari, and was met with a popup window/prompt asking whether I want to open the window/tabs from the previous session. Regardless of whichever option I chose, Safari just froze completely. I tried force quitting, and starting Safari whilst holding the Shift key (which should open a fresh session), but that also didn't work. Following that, I tried starting Safari in Safe Mode, but that also did not work. I should note that at this time Safari Technology Preview was working fine. After half a day of trying to troubleshoot this, an Apple Mail extension (Mailbutler) prompted me to sign in to my Google account, and that process triggered a small window/session of Safari to open (with the Gmail login page). Finally, I was able to access the Safari menubar settings. I went into the menubar settings, deactivated all 20 or so of my extensions, deleted all website data, deleted cache for both of my two profiles, quit Safari, and then tried to open Safari hoping all of that would have fixed it. This time, Safari just froze immediatly without giving me to option of restoring the previous session or not. I tried accessing the Safari menubar settings several times using the Apple Mail/Mailbutler/Gmail login loophole, and after some trial and error I discovered that I was able to open a window with my secondary profile ("Work"), without any problem. I also tried to open a window with my default profile ("Personal"), multiple times - but this always caused Safari to freeze/become unresponsive. At this point, I assumed that the default profile must have been "corrupt" in some way (I have no idea how that could even happen though). I've called Apple Support, and Apple Developer Support, 3-4 times in the last couple of days trying to get help, but as soon as they hear that I am on Sonoma Beta, they just give up and say that they have no obligation to assist customers with beta versions (despite having AppleCare), and the only recommendation they can give is to format the computer and do a complete Time Machine backup restore.. After having spoken to Apple Support, I've tried to reinstall Sonoma three time. I have tried to selectively, and completely, delete the Safari library files (and then restoring backups when noticing that it hasn't worked). I have also tried to use Cookie (by SweetP Productions) to delete various Safari files, hoping that might fix the issue. Finally, I've tried to delete all of the Safari library files (with backups), and then using Time Machine I've attempted to restore all the files that were used by Safari prior to the Sonoma upgrade (this also didn't work). Earlier today I decided to simply give up, and just forget about Safari. After all, Safari Technology Preview was working fine, and I could just use that until Apple pushes a new Sonoma update (which would hopefully repair Safari). But after half a day of using Safari Technology Preview, I now seem to have run into the exact same problem. Right now, both Safari and Safari Technology Preview are completely broken. Both programs become unresponsive the moment they are launched. As Apple provides the dmg file for Safari Technology Preview on their website, I figured I should at least be able to simply reinstall the app and that would solve the problem. But reinstalling Safari Technology Preview doesn't seem to do anything at all. Long story short - I have somehow managed to break both Safari and Safari Technology Preview after upgrading from Ventura 13.6.5 to Sonoma‌ 14.4. Apple are telling me they won't provide any help as I am using beta software. If anyone has any suggestions or ideas for how to solve this (for example, deleting any of the library/support files?), please don't hesitate to share. Thanks
0
1
449
Feb ’24
WebXR Microphone Input Issue
Hello, I'm developing a WebXR application in Safari on visionOS. This app uses the microphone input in WebXR. I've noticed that with the microphone permission allowed the audio input doesn't capture. The size of the blob is always 0. I made a small demo here: https://github.com/chrisdubya/avp-threejs-webxr-test I've tried this demo on other WebXR supported HMDs and the audio capture works fine.
0
0
534
Feb ’24
[bug report] Unicode characters with "variation selectors" are not rendered in the iPhone Safari browser (webkit) with iOS 17.3
Environment: iPhone 14/15, iOS 17.3 Description: Unicode characters with "Variation Selectors Supplement" code can be rendered correctly in all iPhone before iOS 17.3 . But in iOS 17.3, these characters become "blank" in iPhone. Fonts with Variation Selectors are used for displaying alternative Chinese characters reprensenting different pronoucation and different stroke styles. Screen capture from an issue case in iOS 17.3 (bad): Screen capture from a good case in other OS (good): Reproduce steps: Download a "Variation Selectors" supported TTF font https://github.com/ButTaiwan/bpmfvs/releases/download/v1.400/BpmfZihiKaiStd.zip Unzip the ttf font file "BpmfZihiKaiStd-Regular.ttf" from the zip to a folder In the same folder, create an file "index.html" with the following content: <head> <meta charset="utf-8"> <style> @font-face { font-family: zihaibpmf; src: url('BpmfZihiKaiStd-Regular.ttf'); } </style> </head> <body> <table class="redboder" border> <tr><td> Unicode Text </td><td style="font-family:zihaibpmf;">一</td><td style="font-family:zihaibpmf;">一󠇡</td><td style="font-family:zihaibpmf;">一󠇢 </td></tr><tr><td> Unicode Hex Code</td><td> 0x4E00</td><td>0x4E00 0xE01E1</td><td>0x4E00 0xE01E2 </td></tr> </table> </body> Upload the files to a web server Browser the "index.html" with an iOS 17.3 iPhone 14 or 15 There should be a character displayed in each table cells. But with iOS 17.3, two of the cells are blank. Reference: opensource IVS TTF font github: "BpmfZihiKaiStd" TTF Font file download : https://github.com/ButTaiwan/bpmfvs/releases/download/v1.400/BpmfZihiKaiStd.zip "Variation Selectors Supplement" is supported by all other OS (Windows, Android, Linux, old iOS, macOS), see : wiki : Variation Selectors Supplement https://en.wikipedia.org/wiki/Variation_Selectors_Supplement wiki : Variant form (Unicode) https://en.wikipedia.org/wiki/Variant_form_(Unicode) ...Variation Selectors Supplement is a Unicode block containing additional variation selectors beyond those found in the Variation Selectors block. These combining characters are named variation selector-17 (for U+E0100) through to variation selector-256 (U+E01EF), abbreviated VS17 – VS256.
4
1
868
Feb ’24
Having issues clearing cookies in Safari via NextJS
I have a web application built in NextJS that I use cookies to handle persisting authentication details. I clear the cookies on logout and this works in other browsers. However, when I run this on Safari, it seems the browser is caching the cookie information. When I use the Safari debugger, I do not see the cookies in the Storage view, however, when I use document.cookies, I can retrieve them fine - which should not happen. This is not the case in Chrome. I can't find any information on this online, so any help or insights would be greatly appreciated.
0
0
565
Feb ’24
Safari(>17) in Private mode strips GET query parameters from window.location
In Safari 17's private mode, an inconsistent behaviour has been observed where GET query parameters are stripped from window.location after following user's click on any link with GET query parameters. The issue is reproducible for any link with GET query parameters. This issue varies; in some cases, the parameters remain visible in the URL, while in others, they are removed. (The window.location is always stripped of the query parameters). This behaviour impacts both iOS and MacOS users, suggesting a broader issue with Safari's treatment of URL parameters in private mode. The issue is not reproducible on both Safari < 17 and Safari 17 in Normal mode. Most probably it is the result of adding Advanced Tracking and Fingerprinting Protection in Safari 17. Can you please clarify logic behind Advanced Tracking and Fingerprinting Protection? Is it an expected behaviour?
1
0
836
Feb ’24
Safari on macOS does not update the SDR/HDR information about the display on which it is displayed
I have noticed that Safari on macOS does not update the SDR/HDR information about the display on which it is displayed if you refresh the page. Specifically if I use this query and set my MacBook Pro monitor to XDR the result will be "HDR true", but if I then set the monitor to a non-HDR mode like "Photography P3" and refresh the page the result is still the same. The only way is to close the tab, open a new one and launch the query again. This behaviour does not happen with chrome for example, a simple page refresh is enough. The problem in common use can be found on YouTube with an HDR video. If the YouTube player page is already loaded and you change the monitor settings (from SDR to HDR or vice versa), you are forced to close and open a new browser window to have the player loaded with the correct video format. You can check this behavior directly on the site I developed for the HDR test wide-gamut.com It would definitely be more efficient if this information was updated simply by reloading the page.
1
0
381
Feb ’24
Videojs player issue on iOS 17 software update
Hi, After iOS 17 software update, we've encountered an anomaly with the video element within our videojs player. Upon video load, there's a noticeable shift and recentring of the video to its correct position. This issue becomes more pronounced when the player is in a horizontal orientation while the video being played is vertical. Additionally, we've observed resizing and cropping issues during the initialization of the player, which were not present in earlier versions. In our current implementation, we have a canvas element inserted before the player. Due to resizing, the video sticks to the canvas and fails to return to the correct position. <div> <video class="vjs-tech" webkit-playsinline playsinline src="hls video source"> </video> <canvas style="filter: blur(15px)" class="vjs-tech custom-canvas" width="412" height="320"> </canvas> </div>
0
0
931
Feb ’24
In safari for IOS17 audio is broken
Hello community, first post I hope to meet the guidelines. I am developing a web site that uses a library that involves audio playback. This playback is accompanied by an animated canva, and in the IOS17 version in safari, this does not work. The audio is muted and the canva does not animate. However, in ios16 safari it works perfectly. I have also tried in safari on MacOs and ipadOs and it works, which makes me see that the problem is with ios 17 safari. The library in question is this: https://github.com/foobar404/Wave.js/ I don't think the failure is in the library since it works as I said in all other platforms. Specifically the code is here: https://github.com/foobar404/wave.js/blob/main/src/index.ts and makes me think that some HTML element is being incompatible. It is necessary to emphasize that in ios17 it does not work, but it does not appear any error in console. I would love to get help or know if this is a bug to report it.
0
0
778
Feb ’24
WKWebView very slow on GC resulting App Crash
Hi Team, We are working on one of the Acute Healthcare Imaging application and application is running under WKWebview controller. We have observed many crashes when GC doesn't get executed in timely manner. This is very critical healthcare app which has direct impact on patient care. Appreciate any guidance or direction to force GC or optimized dereferenced objects. Thanks in advance for your attnetion. -RA
1
0
453
Feb ’24
How to take a screenshot of a tab
Hello, Is it possible to take a screenshot of a non-active tab? Firefox supports this via captureTab (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/captureTab) With Safari App extensions that was possible via getScreenshotOfVisibleArea which doesn't seem to work with Safari extensions.
1
0
447
Feb ’24