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

Websocket getting cut off when working with CallKit API, iOS 17.5 and higher
Hello! I've been maintaining a Cordova-based calling application for years. Cordova uses a webview to show the user interface and has a bridge for calling native iOS API from JavaScript. The application uses CallKit and VoIP push notifications to handle the calling functionality. Before the iOS 17.5 update, calling worked relatively stable. However, starting from this version and on, Safari instantly force-closes all open websocket connections when the "Answer" button on the calling UI is hit. So, basically, the call ends right after it answers, because in our case websockets are crucial for the SIP negotiation process. Firstly, I inspected the Safari console, and there is a new red error saying: WebSocket connection to 'wss://home.thirdlane.com/wss' failed: The operation couldn’t be completed. Software caused connection abort. Secondly, I checked the Xcode logs, and there are several warnings saying Invalidating grant <invalid NS/CF object> failed every time the call is answered. And, I'm afraid this is all that I have to cling to. I managed to mitigate the effect by connecting the websockets only when the call is answered and the application is focused. However, this approach has its own drawbacks and doesn't solve all the problematic cases. I must mention that the behavior has slightly improved in iOS 17.6 – now the websockets are cut after the "Answer" button hit whereas in 17.5.1 they were cut in ~3 seconds after the VoIP push regardless of whether the answer was made. This looks like a Safari/WebView bug to me and I would like bring it to the Apple's attention. I've never filed a bug before, so hopefully this is the right place to write. I can provide more logs or vidoes upon request. Thank you!
0
0
479
Aug ’24
SafariDomains Per App VPN Profile Error on iOS 18.0
Operating System Version: iOS 18 (from beta 1 to beta 4) We have a VPN app that installs a per-app VPN profile with SafariDomains to filter Safari network traffic. This setup works as expected on iOS versions lower than 18.0. See here more details on SafariDomains: https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf On iOS 18, all SafariDomains configured to go through the per-app VPN result in the following error: "Safari can’t open the page. The error was: Unknown Error" Additional Details: Only SafariDomains encounter this error. Other managed apps traffic through the per-app VPN works correctly. Steps to Reproduce: Install the VPN app with a per-app VPN profile. Configure SafariDomains with any URL (e.g., example.com). Open Safari and navigate to the configured URL. Example Configuration: We tested with a simple example by adding only one URL to SafariDomains (example.com). Logs from the console were captured at the moment Safari opened and encountered the error. example7.txt Has anyone else encountered this issue on iOS 18? Any insights or solutions would be greatly appreciated. Thank you!
1
4
265
Aug ’24
modifyHeaders safari extension not works
Does safari support modification of request headers by using declarativeNetRequest? I want to change the sec-fetch-dest, sec-fetch-mode value in request header using declarativeNetRequest. So I just set the manifest value as follows. { "manifest_version": 3, ... "name": "modifyHeader test", "description": "sample extension", "version": "1.0", ... "permissions": [ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "activeTab" ], "declarative_net_request": { "rule_resources": [ { "id": "ruleset_for_test", "enabled": true, "path": "test_rules.json" } ] }, "host_permissions": [ "<all_urls>" ], .... "content_scripts": [{ "js": [ "content.js" ], "matches": [ "*://www.acmicpc.net/*" ] }], .... } And test_rules.json is as follows { "id": 1, "priority": 1, "action": { "type": "modifyHeaders", "requestHeaders": [ { "header": "sec-fetch-dest", "operation": "set", "value": "document" }, { "header": "sec-fetch-mode", "operation": "set", "value": "navigate" } ] }, "condition": { "domains":["acmicpc.net"], "resourceTypes": ["xmlhttprequest"] } } However, safari does not change the request header. So I just wonder does safari allow modification of headers through declarativeNetRequest.
2
0
348
Jul ’24
declarativeNetRequest modifyHeaders support in Safari macOS (17.1(19616.2.9.11.7))
Is declarativeNetRequest with action type modifyHeaders supported in safari web extension? To modify request headers with declarativeNetRequest, I just modify the manifest.json as below. { "manifest_version": 3, .... "permissions": [ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "activeTab" ], "declarative_net_request": { "rule_resources": [ { "id": "ruleset_for_extension", "enabled": true, "path": "rules.json" } ] }, "host_permissions": [ "<all_urls>" ], "background": { "service_worker": "background.js" }, "content_scripts": [{ "js": [ "content.js" ], "matches": [ "*://www.acmicpc.net/*" ] }], .... } And rules.json is as follows { "id": 1, "priority": 1, "action": { "type": "modifyHeaders", "requestHeaders": [ { "header": "sec-fetch-dest", "operation": "set", "value": "document" }, { "header": "sec-fetch-mode", "operation": "set", "value": "navigate" } ] }, "condition": { "domains":["acmicpc.net"], "resourceTypes":["xmlhttprequest"] } } It builds successfully but not modify headers with as intended even though the permission in safari is enabled.
0
0
236
Jul ’24
iOS:Open a Welcome Page in Safari, not CNA (post-authentication)
"When I connect a device to a special Wi-Fi network, I want users to authenticate themselves. The authentication page is opened using CNA (Captive Network Assistant) on iOS, but CNA has limitations and does not meet my needs. Is it possible to directly launch Safari after connecting to Wi-Fi? Or, can the CNA page have a button or link that quickly redirects users to Safari? How should I proceed?"
4
0
236
Jul ’24
WebKit crash with iOS 18 beta3 and beta4
We are encountering a crash that occurs more frequently on iOS 18 beta 3 and beta 4. The crash happens suddenly after startup and does not provide a detailed code stack trace. Additionally, we have noticed that WebKit has a new version with fixes available. Could you let us know when this update will be released? webkit has fix this crash: https://github.com/WebKit/WebKit/commit/03200a8c08079e188c3de7a97109a51202cc6c64 https://bugs.webkit.org/show_bug.cgi?id=276620 Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001921c7008 in objc_msgSend (). #1 0x00000001f2848938 in **::Detail::CallableWrapper<WebViewRenderingUpdateScheduler::WebViewRenderingUpdateScheduler(WebView)::$_1, void>::call() () #2 0x0000000194e7bf74 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION (). #3 0x0000000194e7bd18 in __CFRunLoopDoObservers (). #4 0x0000000194eaac80 in __CFRunLoopRun () #5 0x0000000194eaa4c8 in CFRunLoopRunSpecific (). #6 0x00000001e172d1c4 in GSEventRunModal (). #7 0x00000001979f4a90 in -[UIApplication _run] () #8 0x0000000197aa2d1c in UIApplicationMain (). #9 0x00000001023f4064 in main at /Users/Dragon/Desktop/App/qrn-ios//main.m:14. #10 0x00000001bb60e9b4 in start (). detail info is below: SIGSEGV: 0xffffff81ece07608 0x0 + 8268181504 main. 0 0 0x00000001018de5c8 -[CKCrashReporter recordCrashWithSignal:]. 1 1 0x00000001018e15cc SignalHandler. 2 2 libsystem_platform.dylib 0x000000021716fafc 93D52E6D-C21D-3BC4-9C49-EBF71987F78C + 8977309696 3 3 WebKitLegacy 0xffffff81ece07608 0x0 + 8268181504. 4 4 WebKitLegacy 0x00000001ece07608 5BEE83EA-6DB3-357D-A484-0555DAE5C1B8 + 8268181504. 5 5 CoreFoundation 0x000000018fbd6e14 7AD2298D-5B8F-3AF4-9EED-B09B8E0A9653 + 6706372608. 6 6 CoreFoundation 0x000000018fbd6bb8 7AD2298D-5B8F-3AF4-9EED-B09B8E0A9653 + 6706372608. 7 7 CoreFoundation 0x000000018fc05bd8 7AD2298D-5B8F-3AF4-9EED-B09B8E0A9653 + 6706372608. 8 8 CoreFoundation 0x000000018fc05368 CFRunLoopRunSpecific + 6706372608. 9 9 GraphicsServices 0x00000001dbdf81c4 GSEventRunModal + 7983820800. 10 10 UIKitCore 0x00000001927529b0 D2E47210-1C46-3CA7-BBC2-35021B146A13 + 6748045312. 11 11 UIKitCore 0x00000001928 00d54 UIApplicationMain + 6748045312. 12 12 0x00000001000b4080 main. 13 13 dyld 0x00000001b5e40734 94AF19E0-4F2A-332F-A08C-04B9B7CB6FAC + 210740.
1
2
574
Jul ’24
Hardware acceleration safari on iOS/iPadOS
I would like to introduce by saying this is one of the things we need as users to use our devices in a good way. This can help fix issue. This allows for more uses for the devices. also would like a all desktop mode safar where I actually get the proper desktop websites on my devices. You know what I am talking about. some websites have mobile or desktop versions and some don’t and where it doesn’t have it. The platform safari is trying to push it into a mobile site making the website broken in functionality
0
0
286
Jul ’24
ShieldActionDelegate uses a different webDomain than the one I shielded
I shield a web domain picked by users like this (discouragedSelections is an instance of FamilyActivitySelection() btw) : let webDomainTokens = discouragedSelections.webDomainTokens store.shield.webDomains = webDomainTokens The domain is correcly shielded and I can see the restricted screen when I access it via Safari. When I tap on the main button of that restricted view, I receive a different token than the one I got from .webDomainTokens from the code above. Why? override func handle(action: ShieldAction, for webDomain: WebDomainToken, completionHandler: @escaping (ShieldActionResponse) -> Void) { // webDomain here is different from the one in store.shield.webDomains }
2
1
373
Jul ’24
Multichannel Audio App not working on safari
Hi! I am working with a team in developing a multichannel based audio web application. The whole structure is based on multiple tracks playing in sync, so after some research and failed attempts, we ended up going with the solution of having one audio buffer (HTMLAudioElement), containing a multichannel file (specifically 8 channels) that we play, split the channels, process them separately, and play the result back to the user. We started doing this with multichannel wav files, and it worked great but every playback was way too large to be scalable, so we started looking into other multichannel-capable files. So far we have tried aac, opus and webm, none of which has worked properly in safari. I've looked in the apple developer documentation, HLS and all that, and seems like the only option is eac3, but I haven't been able to convert any of my files to that format, and I have been really trying. The other option we have been exploring is decoding opus files with WASM manually, but with little success to date. Has anyone been able to achieve anything similar to this? Thanks!
0
0
274
Jul ’24
Low Version Safari Browser When Download Excel Issue
Hi everyone, when My project (Angular 5) running in Safari Browser, we have a download function, it's download the excel file, end with .xlsx, but when running in low version Safari version, it will have a popup, that is not my project did, it blocked be safari itself, you can check the image, my question is how to hide the 'View' button or directly download instead of show the popup?
0
0
277
Jul ’24
Trying to mimic visionOS UI inside of WKWebView
I'm trying to mimic glossy, semi-transparent blurry backgrounds for my visionOS app inside of WKWebView It's easy to do for menus like on the screenshot below, using semitransparent background and applying backdrop-effect: blur(20px) The problem I have is when I make the whole window like this by specifying webView.isOpaque = false and applying to body background-color: transparent. In this case, suddenly, the backdrop-effect: blur stops working for menu. See picture below: You can clearly see that blur is not working anymore since you can see 3 dots behind the menu. I did not touch any CSS properties for the menu itself, only making the whole window semi-transparent. Is there any workaround for this problem? For me it's a blocker to make UI to feel native to visionOS.
0
0
295
Jul ’24
Apple SSO doesn't work anymore
this.app.fire('UI:LOADING', true); this.signInSSOElement.enabled = false; console.log('start apple login'); let redirectURI = 'https://account.ohhh-inc.com'; AppleID.auth.init({ clientId : 'com.ohhhinc.sso.service', scope : 'email', redirectURI : redirectURI, responseType: 'code', responseForm: 'formpost', state : Date.now().toString(), nonce : 'ohhh.incisaperfectdeveloper', usePopup : true }); try { const data = await AppleID.auth.signIn(); // Handle successful response console.log('Apple login successful:', data); } catch (error) { this.app.fire('UI:LOADING', false); // Handle error console.log('apple login error : ', error); this.app.fire("UI:Free"); if(UserManagement.instance.mode == "Gallery") { this.app.fire('MUSEUM:ToggleUI'); this.app.fire('UI:EnableHambMenu'); } this.app.fire('enableUserButton'); LoginCamille.instance.returnFireEvent = undefined; this.app.fire('login-int:close', { result: 'failed', msg: 'Apple login error.\nPlease try another SSO'}); } }, this); We are doing Apple SSO in Javascript. But we have error : Access to font at 'https://appleid.cdn-apple.com/appleauth/static/bin/cb3432457731/dist/assets/shared-icons.woff' from origin 'https://appleid.apple.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I don't know how to fix this.
1
0
253
Jul ’24
apple sso login stops to work
this.app.on('button:AppleSSO', async function () { this.app.fire('UI:LOADING', true); this.signInSSOElement.enabled = false; console.log('start apple login'); let redirectURI = 'https://account.ohhh-inc.com'; AppleID.auth.init({ clientId : 'com.ohhhinc.sso.service', scope : 'email', redirectURI : redirectURI, responseType: 'code', responseForm: 'formpost', state : Date.now().toString(), nonce : 'ohhh.incisaperfectdeveloper', usePopup : true }); try { const data = await AppleID.auth.signIn(); // Handle successful response console.log('Apple login successful:', data); } catch (error) { this.app.fire('UI:LOADING', false); // Handle error console.log('apple login error : ', error); this.app.fire("UI:Free"); if(UserManagement.instance.mode == "Gallery") { this.app.fire('MUSEUM:ToggleUI'); this.app.fire('UI:EnableHambMenu'); } this.app.fire('enableUserButton'); LoginCamille.instance.returnFireEvent = undefined; this.app.fire('login-int:close', { result: 'failed', msg: 'Apple login error.\nPlease try another SSO'}); } }, this); we are using javascript to initiate apple sso login. It doesn't work. with error. ccess to font at 'https://appleid.cdn-apple.com/appleauth/static/bin/cb3432457731/dist/assets/shared-icons.woff' from origin 'https://appleid.apple.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I am not sure where I should change
1
0
242
Jul ’24
"Font size adjustment feature" in Safari Browser.
Does anyone have experience with the "font size adjustment feature" in Safari? I am encountering an issue where this feature increases the zoom on all text elements despite my attempts to prevent it and no able to scroll. Here are the methods I have tried so far: Media Queries: I added various media queries to control the font size and layout at different screen sizes, but this did not resolve the issue. Meta Viewport Tag: I included the "user-scalable=no" property inside the meta viewport tag to disable user scaling, but it had no effect. CSS Property: I applied the CSS property "-webkit-text-size-adjust: 100%;" to prevent automatic text size adjustments, but the problem persists. Despite these efforts, Safari continues to increase the zoom on all elements. Does anyone have any insights or solutions to effectively address this issue?
0
1
230
Jul ’24
WKWebView login session remains active when app is killed and relaunched.
In our application, we have a button on click of which we are creating a new WKWebView instance and before loading the url clearing website data using WKWebsiteDataStore removeDataOfTypes method to remove allWebsiteDataTypes. The problem is when app is relaunched, the login session remains active whereas the same code ends session and we get login page when the same button is clicked when app is in running mode and not killed. Any suggestion on how to debug or what's going incorrect is really appreciated. Let me know incase of query. Thanks!
0
0
198
Jul ’24
TypeError in FormMetadata.js: null object error on iOS 17.5+ Safari
I'm encountering a TypeError in FormMetadata.js on Safari, primarily affecting iOS 17.5 and later versions. The error message is as follows: TypeError: null is not an object (evaluating 'this._logicalFormForControl(e).formElement') This issue seems to be specific to recent iOS versions, particularly on Safari. Has anyone else experienced this problem or have insights into what might be causing it? Any suggestions for potential workarounds or fixes would be greatly appreciated. Additional details: Occurs consistently on iOS 17.5+ devices Mainly affects Safari browser Error is thrown in FormMetadata.js Thank you in advance for any help or information you can provide.
0
2
370
Jul ’24