Safari and Web

RSS for tag

Enable web views and services in your apps.

Posts under Safari and Web tag

123 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Intercept WebView requests and add Auth token in all subsequent resource request [GET .js, .png, .css].
Intercept WebView requests and add Auth token in all subsequent resource request [GET --> .js, .png, .css]. We have tried the below delegate methods and those call are not getting invoked. We have a challenge with Webview when load our application URL. func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { we are looking for some delegate or protocol to intercept the request to add the token for all the requests. is there any possible solution to fix this issue? Thanks
1
1
751
Feb ’24
Dummy overlay 0 sec video player - Modernizr
Post iOS 17 version update on Dec 12, we are facing a weird issue. When accessing https://infinitiusa.com/ website from Chrome browser/FaceBook App, there is an dummy overlay with a 0 sec video player (Overlaying full screen as blank). On closing the video player we can see the website is loaded fine. We cross checked few other websites and found the websites using Modernizr (https://cdnjs.com/libraries/modernizr) is having the issue post iOS update. Is any issue similar issue reported ?
0
0
391
Jan ’24
How to have JS Website interact with a mutable file
I learned that I can't have a file inside the bundle if I want it to be able to be changed while the app is running. If I have a file stored outside, how could I let an HTML website access that JS file? I'm using WKWebView to run a local website. The JS would need to be accessible by the website before it loads, because it is a configuration file that is needed on load.
0
1
303
Dec ’23
chrome extension converted to safari, chrome.runtime.sendMessage does not work on iOS
My Chrome extension runs fine on Chrome, but when I use the following command to run it on Safari, I find that the result returned by chrome.runtime.sendMessage is always Undefined. xcrun safari-web-extension-converter --app-name MySafariTest dist The following is my code content.js: async test() { return chrome.runtime.sendMessage({ method: "test" }) } let result = await this.test() // result is always undefined background.js: chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { sendResponse("test123") }); I want to know if there is any way to make the content script and background script of Chrome communicate normally in Safari?
0
0
402
Dec ’23
How to influence 'Automatic' format selection of photos in iOS Safari photo picker?
In my app mobile web app, it is common for users to select lots of photos at once. One of the issues is that by default, it seems that iOS converts the photos selected before returning them, and doesn't have a good UX for indicating what it is doing. It just looks like nothing happens after you tap 'Add'. The more photos selected, the longer it takes as it is converting them in the background without an indication of what is happening. My app can handle unconverted, HEIC format, photos. So it is ideal if the photo picker from Safari just returns the images in their original format. In iOS 17, there is an 'Options' button in the picker that provides a 'FORMAT' selection which defaults to 'Automatic'. The other 2 options are 'Current' and 'Most Compatible'. The subtext indicates that 'Automatic' will use the 'best format for the destination'. Given that, is there a way for me to indicate to the photo picker from safari that 'Current' is the best format for my destination? I tried setting the 'accept' attribute on my file input field to be 'image/*' which I thought made the most sense. But it still seems to default to converting all the images. It is a pain to have to educate users to manually go and adjust the format option to be 'Current'. It would be great if I could indicate in my html file input field that I want the picker to return non converted files. I can't find a way to do this, or really any documentation about this for that matter. If anyone knows where documentation is, or how to do it, I would appreciate the help greatly :). Thank you! Josh
0
0
394
Dec ’23
iOS 16.7.2, iOS 17.1.1: navigator.permissions.query permissionStatus inconsistent response
I am developing a web application that uses the camera and microphone. As part of this, I need to ask for camera and microphone permissions and also handle changes in these permissions. However, a few issues were discovered in Chrome on iPhone and iPad. The issue I encountered is that, after attaching an onchange event listener to the status obtained from navigator.permissions.query({name: "microphone"}), there was no detected change in permission state even after camera and microphone permissions were granted. However, when I directly executed navigator.permissions.query({name: "microphone"}) in the Safari JavaScript console, it showed a different state value compared to the status object I created. The status object continuously displayed "prompt", while the direct console query showed "granted". I suspect that the status object is not being updated in real-time with the browser, or there might be a bug since the onchange event was added quite recently (around September 2022, as far as I know). Is anyone experiencing similar issues, or does anyone know how to resolve this problem? Below is a list of the devices I have tested with. iPhone: iPhone 13 iOS 16.7.2 (maybe safari version is same) agent AppleWebKit 605.1.15 criOS 119.0.6045.169 Mobile 15E148 Safari 604.1 chrome version 119.0.6045.169(official build) iPad: iPad Air 4th iOS 17.1.1 (maybe safari version is same) agent AppleWebKit 605.1.15 criOS 119.0.6045.169 Mobile 15E148 Safari 604.1 chrome version 119.0.6045.169(official build)
0
2
680
Dec ’23
Safari on MacBook doesn't send http/2 WINDOW_UPDATE frame
Hello Sirs, I've developed http/2 server, tested with nghttpx, Edge, Mozilla, Chrome web browsers, all seems to be fine. As I navigate to an url under my http/2 server with Safari browser (ver 17.^) on MacBook 2023, the server is catching WINDOW_UPDATE frame for stream id 0, but unfortunately no WINDOW_UPDATE frames with specific stream Id are sent from Safari http/2 specification tells, that this frame for stream id 0 isn't yet enough to be allowed to send DATA frames to browser. The concrete stream id is needed in WINDOW_UPDATE frame. The INITIAL_WINDOW_SIZE setting of the SETTINGS frame from Safari is only 100 bytes. I just send the response SETTINGS frame with ACK flag set true, not trying to increase this setting's value. Now the server just sends first DATA frames for each stream, and Safari fetches them, renders and shows in browser, however the streams' window sizes are exhausted. But I'm not risking pushing all DATA frames of larger files, so that other browsers then don't RST these streams. Any infos for me please about specific Safari http/2 frames flow?
2
0
362
Nov ’23
xcodebuild failure: xcodebuild failed with code 70
webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70 [0-0] xcodebuild error message: [0-0] . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device. I'm using macOs 13.6 xcode 14.3 Iphone Os 16.7.2 running with webdriverIO still getting this error can anyone help me in this please.
0
0
907
Nov ’23
Safari browser on iPhone 14 Pro (ios 17.1), Web Speech API encountered problems after Bluetooth speaker connection
Problems when connecting Bluetooth speakers on iOS devices. When trying to use the Web Speech Api -(Text-To-Speech) in safari immediately after connecting to a Bluetooth speaker, it playing the sound using the phone's speakers instead of the connected Bluetooth speaker's. Then, when I summon Siri and briefly use the voice function, the Web Speech API in the web browser uses the Bluetooth speaker, and it works. It seems that there may be some kind of limitation or issue when switching between Bluetooth devices and voice apis.
1
0
446
Nov ’23
How to view the source code of the request message when opening the network menu in Safari browser (view source code)
The Mac Safari version is 17.0. To enable developer options, go to the menu, select "Advanced," and check "Develop." You can inspect web page requests by right-clicking in the web page and selecting "Inspect Element" from the menu. In the "Network" tab, you can capture the page's request messages. However, it seems that Safari does not have a "View Source" option. Is it the case that Safari does not have this option? Not having this option can be quite inconvenient.
0
1
425
Nov ’23
Deep links are not directing users to the intended apps, instead, they are redirecting to the respective apps on app store
Problem : Deep links are not directing users to the intended apps, instead, they are redirecting to the respective apps on app store. When clicking on a deep link in private mode, it consistently displays a prompt to open the application or cancel. If the "Cancel" button is selected on the prompt, it redirects to the app store via a deep link to open the specific application, on next time onwards we are not receiving the prompt to open application, every time it get redirects to the appstore via merchant link automatically. In other case if we click open button on the prompt , it redirects to the application, Subsequently, each time we click the deep link, it repeatedly prompts us to open the app. Why do the "Open" and "Cancel" buttons lead to different outcomes in these scenarios? How can we ensure that the application always opens when clicking on the deep link, if it is in private mode as well?
0
0
586
Nov ’23
iOS Web Push - Passing in Icon Doesn't Work
Hey everyone, I did some extensive testing with sending a Web Push notification to my iOS PWA as well as MacOS Safari browser. The push itself works for those platforms but passing in the icon as specified in: https://developer.mozilla.org/en-US/docs/Web/API/Notification/icon does not work. It always just defaults to using the icon defined in the PWA's manifest instead. In the support matrix in the link above it says Safari is supposed to support this but it doesn't. I just wanted to get some second opinions to confirm that it's a known issue that it's broken? I know iOS Web Push was just supported fairly recently so I'm hoping this gets resolved in the future for us to pass in custom icons.
0
0
514
Nov ’23
WKWebView: Failed to acquire RBS assertion 'WebKit Media Playback'
Hi there! I'm new to App Development and I'm running into the following error when playing audio on a website loaded through a WKWebView: 0x112000cc0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=70.197, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)} Looking through this forum, it seems more people have this issue, yet no one has found a solution (or posted it...). The solutions that I did find (Background Modes capability, webView.configuration.allowsInlineMediaPlayback = true), did nothing. To make sure the issue had nothing to do with my own code, I created an empty project to reproduce the issue. I'm not sure on the best way to share it, but it's a small file (forgive me, I have no clue what it does, actually chatGPT made it for me. My real application is a WebApp wrapped with Capacitor, so it handles all the Swift stuff) import SwiftUI import WebKit struct WebView: UIViewRepresentable { let urlString: String func makeUIView(context: Context) -> WKWebView { let webView = WKWebView() webView.configuration.allowsInlineMediaPlayback = true webView.configuration.allowsAirPlayForMediaPlayback = true webView.navigationDelegate = context.coordinator return webView } func updateUIView(_ uiView: WKWebView, context: Context) { if let url = URL(string: urlString) { let request = URLRequest(url: url) uiView.load(request) } } func makeCoordinator() -> Coordinator { Coordinator(self) } class Coordinator: NSObject, WKNavigationDelegate { var parent: WebView init(_ parent: WebView) { self.parent = parent } func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { print("Web page loading failed: \(error.localizedDescription)") } } } struct WebViewDemo: View { var body: some View { NavigationView { WebView(urlString: "https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all") .navigationBarTitle("Web View") } } } struct WebView_Previews: PreviewProvider { static var previews: some View { WebViewDemo() } } Nothing special, right? When I build the app and navigate to a website that has an tag (https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all). I still see the error when I play the audio. It plays nonetheless, but the error is there. I'm not at all interested in actually playing audio in the background/when the app is closed/suspended. I just want the error to go away! I've tried different iOS versions (14,15,16,17), but the problem persists. Anyone know what's happening?
3
3
3k
Oct ’23
iOS/Safari 17 does not support COLR/CPAL (v0) format color font
I take these websites to test COLR/CPAL(v0) format color font: https://yoksel.github.io/color-fonts-demo/ https://pixelambacht.nl/chromacheck/ In my iOS 17 device, both websites show unsupported of COLR/CPAL (v0) color font, however, on my other iOS 16 devices, it is supported. COLR/CPAL (v0) color font format is widely supported on mainstream browsers currently, from Blink (Chrome) to WebKit (Safari desktop), why does iOS deprecate it?
1
0
549
Oct ’23
Safari, WKWebView video slow loading issue
my web service has video content. the problem is in chrome browser, downloading and playing video is much faster than Webkit browser (Safari and WkWebView). we are struggling to find the reason why there is huge gap between two browsers. we've checked browser inspector and there's something look like error in safari inspector that doesn't appear in chrome. There are two cases in network section. First red header case that I think something went wrong Second yellow header csae that I think succeeded to donwload
0
0
486
Oct ’23