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

All subtopics

Post

Replies

Boosts

Views

Activity

webpush
hi anybody can help me with webpush fcm? after some hours and pwa closed the webpush notification doesn't arrive until i re-open webapp and recreate a new token
0
0
138
2w
safari push notification endpoint always empty
Hi, I implemented push notifications on my PWA, and it work fine with all browsers except with Safari. I followed all the recommendations given by Brady Eidson in this video : Meet Web Push for Safari And the result is that all the push notification process work fine with others browsers, from the subscription to the notification delivery and display. But with Safari the endpoint is always empty and I do not understand why. No error is triggered during subscription. Just the result is a subscription with an empty endpoint. I have the same result on iPad, iPhone and iMac. Everything is working well with others browsers or with android smartphone. But contrary to what Brady Eidson promised in his video, it does not work with Safari.
0
0
97
2w
Overlay appears in fullscreen mode in Safari when video is paused - how to prevent this via JavaScript
When a video in Safari is played in fullscreen mode and the user pauses it, an overlay (such as a play button or other controls) appears. This affects the user experience, as we want to avoid showing the overlay during fullscreen viewing after the video is paused. Expected Behavior: The overlay should not appear after the video is paused in fullscreen mode. Steps to Reproduce: Open a webpage https://slides-dev.pitchavatar.com/rtxuf in Safari. Start playing the video. Enter fullscreen mode. Pause the video. The overlay appears after the video is paused. Screenshot: Additional Information: Safari version: Safari 18.0.1 (20619.1.26.31.7) Environment: macOS Sequoia 15.0.1 (24A348) We would like to know if there is there any way to prevent the overlay from appearing in Safari when the video is paused in fullscreen mode.
0
0
120
2w
Crashing in WKWebview Often, when the video is loaded in the webview using an HTML file
Hello, Team. We used WKWebView for our project. We loaded the HTML file into the webview and added the following configuration. weak var webView: WKWebView! func configWebView() { let webViewConfig = WKWebViewConfiguration() let controller = WKUserContentController() controller.add(self, name: "sometest") webViewConfig.userContentController = controller webViewConfig.processPool = WKProcessPool() webViewConfig.setValue(true, forKey: "allowUniversalAccessFromFileURLs") webViewConfig.mediaTypesRequiringUserActionForPlayback = [] let webpagePreferences = WKWebpagePreferences() webpagePreferences.allowsContentJavaScript = true webViewConfig.defaultWebpagePreferences = webpagePreferences webViewConfig.websiteDataStore = WKWebsiteDataStore.default() webView = WKWebView(frame: .zero, configuration: webViewConfig) webView.navigationDelegate = self webView.uiDelegate = self webView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(webView) NSLayoutConstraint.activate([ webView.topAnchor.constraint(equalTo: view.topAnchor), webView.bottomAnchor.constraint(equalTo: view.bottomAnchor), webView.leadingAnchor.constraint(equalTo: view.leadingAnchor), webView.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) loadWebView() } func loadWebView() { guard let documentsDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return } let contentFolderURL = documentsDirectoryURL.appendingPathComponent("content") let assetFolderURL = contentFolderURL.appendingPathComponent(interactiveGUID) if FileManager.default.fileExists(atPath: assetFolderURL.path) { let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! let documentsURL = URL(fileURLWithPath: documentsPath) let fileToLoadPath = (documentsPath as NSString).appendingPathComponent("content/index_p.html") let fileURL = URL(fileURLWithPath: fileToLoadPath) autoreleasepool { DispatchQueue.main.async { [weak self] in guard let self = self else { return } self.webView.loadFileURL(fileURL, allowingReadAccessTo: documentsURL) } } } We are experiencing webview crashes when loading an HTML file. What happened when I loaded the video file? It automatically looped. Webview frequently crashes when the HTM/JS file is loaded. When a webview crashes, the delegate method usually calls webViewWebContentProcessDidTerminate. This method calls webview.reload(). Also we are clear and cache/ deallocate eveything when i initialized those configuration mentioned as the above. Can you suggest a solution to this? Why is webview crashing? Thank you.
0
0
117
2w
HTML input onChange Event Triggered Multiple Times with Korean Multilingual Keyboard in iOS 18
Description: When using a multilingual keyboard that includes Korean in iOS 18, the input element's onChange event is triggered multiple times instead of just once. This issue occurs not only when entering numbers with input type="tel" or inputMode="numeric", but also when entering text with input type="text". This causes unexpected behavior in forms and other input-related functionalities. Affected Devices and OS Version: Device: iPhone 16 Pro OS Version: iOS 18.0 You can reproduce the issue with this CodeSandbox example: https://codesandbox.io/p/sandbox/elegant-dream-jnqh39 Steps to reproduce: Use a multilingual keyboard (e.g., Korean and English) on iOS 18. Type some text into the input field (input type="text"). Also try entering numbers using input type="tel" or inputMode="numeric". Observe that the onChange event is fired multiple times for both text and numeric input. Expected behavior: The onChange event should only be triggered once when text or numeric input changes. Additional Information: This issue has been reported under feedback ID FB15377631. Currently waiting for a response from Apple regarding this feedback.
0
0
88
2w
关于 Ipad 18 在 Safari 浏览器的 PUT 请求问题
正常情况下,浏览器执行PUT请求会返回上传进度 在Safari 浏览器上,Ipad 16,Ipad 17 均正常,Ipad 18 上传进度返回一直不变 ipad版本兼容性问题 ipad (16+Safari):动作正常(逐步显示上传进度) ipad (17+Safari):动作正常(逐步显示上传进度) ipad (18+Safari):动作不正常(显示1%直到完成)
0
0
49
2w
iOS18 Safari: Page content loses focus after switching to a new tab with chrome.tabs.update
Hi, I have a Safari extension that works well in iOS before 18, which can switch to a different tab with chrome.tabs.update back and forth by keyboard shortcuts. With iOS 18, as Page content loses its focus, it is impossible to trigger content script directly, I have to manually touch screen to put focus back to page content so that keystroke can trigger my content script to talk with background to call chrome.tabs.update to switch back. Please bring focus to page content after switching to a new tab with chrome.tabs.update.
1
0
166
2w
Adding a Safari Extension to Capacitor iOS App as an Application Extension
Hello everyone, I’m working on adding a Safari extension as an application extension to an iOS app created using Capacitor (generated from a React app). My goal is to bundle the Safari extension within the Capacitor app, allowing it to serve as a companion app for the extension. However, I’ve run into issues where the extension does not show up in Safari's extension settings when I run the app on a device or simulator. Here's an overview of what I’ve done so far: I initially used Capacitor’s command line tools to generate the iOS app from my React project. This app runs fine on its own. To add the Safari extension, I’m not developing a platform-specific extension from scratch; instead, I used the Xcode command line to convert a Chrome extension to a Safari iOS extension. The converted extension functions correctly if paired with the default Swift app that comes with the conversion. Right now, I effectively have two products: The base Capacitor app (without the extension), which I want as my main app. The standalone Safari extension bundled with the Swift app (from the conversion process). My question is: How can I merge these two products so that the Capacitor app becomes the companion app for the Safari extension, allowing the extension to show up in Safari's settings? Are there specific configurations I should adjust in Xcode or within the manifest files to make this work seamlessly? Any guidance or best practices from others who have integrated Safari extensions into non-Xcode-based projects would be much appreciated! Thank you!
1
0
191
2w
RTCPeerConnection is undefined on page loaded in Mac WKwebview
Hello I have a webrtc-based web app that is loaded inside a WKWebView. The web app gets loaded just fine in our iOS App running WKWebView on an iPad with iOS 15.1. We are using the exact same app, built for Mac Catalyst. However, on the Mac version, the web app gets loaded but the RTCPeerConnection object is undefined.. Meaning that our web app assumes that WebRTC is not available in that browser. Isn't the native app supposed to work the exact same on iOS and MacOS? Is the Mac version of WKWebView more limited than its iOS counterpart ? Is there any resource that states exactly what is supported in WKWebview in each platform? Thanks
3
0
1.6k
Dec ’21
WKWebView can't connect to external content in iOS 17.5+
My app Frax has long used a mechanism where a local webpage calls out to web-hosted content. In iOS 17.5+ (and iOS 18 beta) this has recently stopped working. The content fails to load, and the console log (running on iOS 17.6.1) contains: nw_application_id_create_self NECP_CLIENT_ACTION_GET_SIGNED_CLIENT_ID [80: Authentication error] Failed to resolve host network app id followed shortly by: Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}> 0x128024480 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=9736, error: (null) This same code has worked reliably for years, and continues to work properly under iOS 16 and earlier. But there are increasing reports of this new error showing up around the web. Nothing in recent iOS 17 release notes sheds any light on what might have changed, and all my efforts to troubleshoot or mitigate this issue have failed. Any help on how to solve or work around this would be greatly appreciated!
7
4
2.6k
Aug ’24
Shape Detection API (Barcode Detector)- Safari 18.X
Hi Folks, do you know what happend with the "shape detection API" feature flag on Safari 18.X (IOs 18.X)?... in previous versions (17.X) i enabled the "shape detection API" feature flag and was able to detect codes like mentioned here... https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API#browser_compatibility I built a PWA (Service Worker) with Angular 18 and facing this issue immediately after updating to IOS 18.0 (I enabled/disabled the flag, restartet the device several times... no success at all) Do you have an Idea what changed or how i can enable that feature again? Thx a lot in advance.. Cheers Martin
1
1
233
2w
IOS 18 Safari on Mobile data network not uploading files
Hello, I am facing a strange issue on iOS 18. After upgrading to iOS 18, I noticed the following problem: When connected to mobile data (with Wi-Fi turned off) and trying to upload a file larger than 1MB, the connection times out. However, if I repeat the same action using Wi-Fi, everything works fine. I have tested this issue in various ways, but nothing seems to resolve it. It appears that iOS 18 might have introduced a bug. You can replicate the issue using this site: https://video.online-convert.com/convert-to-mp4 (Note: this is not my page, but I found the same issue here). From the server access logs, I see successful pre-flight requests, but the main POST request never follows, which suggests that the client is not sending the request.
11
5
980
Sep ’24
how to prevent YouTube app from opening.
Hello I am having issues where when I open a link to YouTube in a wkwebview it opens up the installed YouTube app. I have tried my own way of blocking the opening of the YouTube app but it seems I'm stuck. Is there a way to prevent certain apps from opening automatically from links clicked on or traveled to? Here is what I have so far. guard let url = navigationAction.request.url else { decisionHandler(.cancel) return } //not sure why this code is not being used... // Check if the navigation is a link click with target="_blank" if navigationAction.targetFrame == nil { // Handle the navigation request to open a new window if let url = navigationAction.request.url { // UIApplication.shared.open(url) //opens in safari.... let request = URLRequest(url: url) webView.load(request) decisionHandler(.cancel) return } } // Continue with the navigation if not a link with target="_blank" if url.scheme == "youtube" || url.scheme == "music" { decisionHandler(.cancel) return } //this should cancel app opening for youtube:// links and apple music. // if let url = navigationAction.request.url { // // Allow Google sign-in redirects // if url.absoluteString.contains("accounts.google.com") || url.absoluteString.contains("gstatic.com") { // decisionHandler(.allow) // return // } // } if url.absoluteString.hasPrefix("http") { decisionHandler(.allow) return } if let url = navigationAction.request.url { if shouldDownloadFile(from:url) { // if navigationAction.navigationType == .other, let mimeType = navigationAction.request.allHTTPHeaderFields?["Content-Type"], mimeType.contains("application/pdf") { downloadFile (from: url) decisionHandler(.cancel) return } } decisionHandler(.allow) }
1
0
144
2w
WKWebView crashes after repeated reloads on iOS 18
Hi! I have a rather complicated SwiftUI browser app with a WKWebView. There is an option to reload the website after a configurable amount of time. Starting with iOS 18, the app crashes after repeated reloads. How many reloads that are required depends on the device, sometimes 100, sometimes 1000. Reloading is done via a timer that triggers the following code on the main thread: let request = URLRequest(url: url, cachePolicy: policy) self.parent.webView.load(request) The URL is configurable and cachePolicy can be either .reloadIgnoringLocalAndRemoteCacheData or .useProtocolCachePolicy How the crash affects the device also differs from device to device and from time to time. I have suffered from the following crashtypes: App is killed App is killed and Safari also stops working App is killed and the whole OS is really slow The WKWebView stops loading and hangs at 20%. The device is rebooted My app has an option to disable cache. Cache is disabled by setting cachePolicy to .reloadIgnoringLocalAndRemoteCacheData and by removing all cache in a rather complicated way. Basicly i'm doing something like this: dataStore.removeData(ofTypes: types, modifiedSince: Date.distantPast, completionHandler: nil) if let klazz = NSClassFromString("Web" + "History"), let clazz = klazz as AnyObject as? NSObjectProtocol { if clazz.responds(to: Selector(("optional" + "Shared" + "History"))) { if let webHistory = clazz.perform(Selector(("optional" + "Shared" + "History"))) { let o = webHistory.takeUnretainedValue() _ = o.perform(Selector(("remove" + "All" + "Items"))) } } } if let cachesPath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first { let contents = (try? FileManager.default.contentsOfDirectory(atPath: cachesPath)) ?? [] for file in contents { if foldersToDelete.contains(file) { let path = cachesPath.appending("/").appending(file) do { try FileManager.default.removeItem(atPath: path) } catch { print("Can't delete cache file: \(path), error: \(error.localizedDescription)") } } } } The cache state affects the intensity of the crash. Disabling the cache shortens the time the app is working, while enabling the cache reduces the intensity of the bug. Based on my investigation, I suspect that loading a website in a WKWebVew leaks memory in iOS 18. If the whole website needs to be requested (= caching off), it results in a more significant memory leak and a faster crash time. Is this a known issue? Am I doing something wrong? Is there a potential workaround?
2
0
239
2w
iOS Simulator Safari JS PushManager.subscribe(...) empty keys
When I run the following code in XCode iOS Simulator on Safari (connecting via Safari DevTools): navigator.serviceWorker.ready.then((reg) => reg.pushManager.subscribe({ userVisibleOnly: true, applicationServiceKey: "..." }).then((sub) => console.log(sub.toJSON()))) I get the response: { keys: { p256dh: "", auth: "" } } But I'm expecting p256dh and auth (and endpoint) to be filled out. Why is it not?
0
1
140
2w
iPadOSにおけるChromeブラウザとWKWebView API利用時のWebRTCカメラアクセスに関する問い合わせ
私たちはJavaアプリケーション開発者で、iPadOS上でのWebRTCによるカメラアクセスに関して、iPadOS 17.1での挙動について質問がございます。 具体的には、iPadOS 17.1でChromeブラウザを利用し、WKWebView API経由でカメラにアクセスしようとした際、エラーが発生し、カメラ撮影が実行できない現象が発生しております。弊社の調査では、WKWebView APIのnavigator.mediaDevicesプロパティを通じたデバイスアクセスが、Chromeで動作しない可能性が示唆されました。しかし、Safariブラウザでは正常に動作するため、Chromeに固有の制限があるのか、またはiPadOSの設定や仕様に起因するのか判断しかねております。 現在、iPadOS 17.1でのカメラアクセスに関するWKWebViewとWebRTCの仕様やChromeでの制約について、ご見解や解決策についてご教示いただけますと幸いです。 どうぞよろしくお願いいたします。
0
0
108
2w
Does Safari Web Push require a paid Apple Developer account (doubt with certificate)?
I need to implement push notifications in Safari. I already have a web app that can be added to the home screen. When researching push notifications in Safari, one of the things I found was that you don't need to be part of the Apple Developer Program to use this feature (text here). But when checking the requirements within the platforms, such as Pusher, they require a type of certificate that can only be generated with a paid account, that is, I need to participate in the Apple Developer Program. Pusher documentation: https://pusher.com/docs/beams/getting-started/web/configure-safari/ Now, I have many questions: Do I really need a paid account to issue the certificate? Can I issue the certificate via the web or only on a Mac? Do I really need this certificate?
1
0
163
2w
Safari - cookie setting default behavior in iOS 18
Hello! I have a question about changes in default behavior of Safari related to cookie setting. We had an issue - our Single Sign On login was not working, because of lost cookie on some step of the flow. Only changes in Safari cross-website tracking settings helped to fix the issue So the question is - are there any official documentation about changes in cookie setting policy in Safari on iOS 18?
0
0
147
2w