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

All subtopics
Posts under Safari & Web topic

Post

Replies

Boosts

Views

Activity

After building in Xcode, my extension is not showing in Safari.
Hi, I had been working on an extension without any issues, running it from Xcode and debugging locally in Safari. However, without making any code changes, and after uninstalling the extension, it stopped appearing in Safari after building for local debugging. Does anyone know what might be happening or how I can clean up the system? Thanks a lot and best regards.
6
0
1k
Oct ’24
Accessing WKNavigationAction.sourceFrame.request crashes
Hi all, I'm currently working with WKWebView and implementing the WKNavigationDelegate protocol. In particular, I'm trying to inspect the sourceFrame of a WKNavigationAction to make navigation policy decisions based on the frame's URL path. Here's the relevant Swift code inside decidePolicyFor: public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, preferences: WKWebpagePreferences, decisionHandler: @escaping (WKNavigationActionPolicy, WKWebpagePreferences) -> Void) { // ... let sourceFrame: WKFrameInfo = navigationAction.sourceFrame let request: URLRequest = sourceFrame.request // <- SIGABRT occurs here // ... } The issue is that the app crashes with a SIGABRT at runtime when attempting to access sourceFrame.request. According to Swift's type system, neither sourceFrame nor its request property are optional, so at first glance this seems safe. However, the crash report suggests otherwise. From the crash log, it appears that the issue arises during the bridging from Objective-C to Swift: Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001a127a030 in static Foundation.URLRequest._unconditionallyBridgeFromObjectiveC(Swift.Optional<__C.NSURLRequest>) -> Foundation.URLRequest () #1 0x00000001056c48b0 in CustomWebViewController.webView(_:decidePolicyFor:preferences:decisionHandler:) #2 0x00000001056c4c78 in @objc CustomWebViewController.webView(_:decidePolicyFor:preferences:decisionHandler:) () #3 0x00000001b8c66e0c in WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction () #4 0x00000001b8fd14dc in WebKit::WebPageProxy::decidePolicyForNavigationAction () #5 0x00000001b8fcfc7c in WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared () #6 0x00000001b8fcfb18 in WebKit::WebPageProxy::decidePolicyForNavigationActionAsync () #7 0x00000001b87ddaa0 in WebKit::WebPageProxy::didReceiveMessage () #8 0x00000001b869f474 in IPC::MessageReceiverMap::dispatchMessage () #9 0x00000001b878dda4 in WebKit::WebProcessProxy::dispatchMessage () #10 0x00000001b878d614 in WebKit::WebProcessProxy::didReceiveMessage () #11 0x00000001b869e7e4 in IPC::Connection::dispatchMessage () #12 0x00000001b869e358 in IPC::Connection::dispatchIncomingMessages () #13 0x00000001b9a96a44 in ***::RunLoop::performWork () #14 0x00000001b9a96688 in ***::RunLoop::performWork () #15 0x00000001a2428b9c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ () #16 0x00000001a24289b4 in __CFRunLoopDoSource0 () #17 0x00000001a2428810 in __CFRunLoopDoSources0 () #18 0x00000001a2429190 in __CFRunLoopRun () #19 0x00000001a242ad4c in CFRunLoopRunSpecific () #20 0x00000001ef705454 in GSEventRunModal () #21 0x00000001a4e45890 in -[UIApplication _run] () #22 0x00000001a4e10cec in UIApplicationMain () #23 0x00000001a4ef261c in ___lldb_unnamed_symbol275689 () #24 0x00000001059a5104 in static UIApplicationDelegate.main() () #25 0x00000001059a5074 in static AppDelegate.$main() () #26 0x00000001059a82ec in main () #27 0x00000001c940af0c in start () This implies that while Swift treats sourceFrame.request as non-optional, the underlying Objective-C implementation may actually return nil—leading to a crash when the non-optional Swift type attempts to force unwrap it. My question: Is there a way to safely access navigationAction.sourceFrame.request —- or determine if it’s nil—before Swift attempts the implicit bridging from Objective-C? Or is there an established workaround for safely inspecting this property? Any guidance or best practices for avoiding this crash would be greatly appreciated! Thanks in advance.
Topic: Safari & Web SubTopic: General Tags:
3
0
86
Apr ’25
2016 MacBook Pro popping sounds
I got a second-hand have MacBook Pro and sometimes when I run apps the Mac will start popping every 10-30 minutes. I'm not sure if this is something that happens normally because this is an intel MacBook. If someone knows the answer to my question then please respond Thanks!
Topic: Safari & Web SubTopic: General Tags:
1
0
305
Oct ’24
Issue with WebM Video Transparency Rendering on iOS
I'm experiencing a persistent issue with transparent WebM videos rendered via WKWebView in an iOS Capacitor app. The videos play normal, however, they display a black background frame, which does not occur in the web version of the app. I've tried: Playing with the css setting, Enabling experimental WKWebView features, Adjusting meta tags for inline video playback and hardware acceleration. That my code: showThumbs={false} showStatus={false} showIndicators={true} showArrows={false} infiniteLoop={true} autoPlay={true} interval={5000} // Change slide every 5 seconds onChange={(index) => { if (playerRefs.current[index]) { playerRefs.current[index]?.seekTo(0); playerRefs.current[index]?.getInternalPlayer()?.play(); } }} > {videos.map((video, index) => ( <div key={index} className="video-slide"> <ReactPlayer ref={(player) => (playerRefs.current[index] = player)} url={video.src} playing={isLoaded[index]} // Play only when video is loaded loop muted width="100%" onReady={() => handleVideoReady(index)} // Set loaded state when video is ready style={{ backgroundColor: 'transparent' }} config={{ file: { attributes: { playsInline: true, }, }, }} /> <p className="description">{video.description}</p> </div> ))} </Carousel> Working with React, capacitor. The videos work perfect when I test it on the web app, the problem occurs just on my ios app
Topic: Safari & Web SubTopic: General Tags:
2
0
1.2k
Nov ’24
Enable a Developer ID-signed and notarised extension without enabling "allow unsigned extension"
Hello, According to the documentation: If you provide your extension in macOS and don’t want to use the Mac App Store for distribution, you can sign and notarize your extension’s app with a Developer ID to distribute it outside the Mac App Store. However, I found this to be untrue in practice. Even after signing and notarising the Safari extension correctly, it is not possible to enable it in Safari without turning on "allow unsigned extension". This makes it impossible to distribute your Developer ID–signed and notarized extension outside the Mac App Store. I would like to distribute my web extension directly to employees in my organization using MDM without having each user manually enable "allow unsigned extension" for it to work. Any way to make it work? The documentation is quite confusing in this aspect, it says "Safari only supports signed extensions" but my extension is rejected even if notarised and signed.
3
0
122
Apr ’25
faulty Transparent Video in iPhone browsers
I need to play a Video with transparent background on our website. It works perfectly on Windows, Mac & Android (in all browsers). On iPhone however, no matter what Browser, The transparent parts of the video act almost like an "overlay", making everything behind it a lot brighter. This effect gets worse, the higher I set the iPhone screen brightness. This is of course not the behavior I'm looking for. The Video Element has two listed sources. One .WEBM (VP8 with alpha channel) and one .MP4 (HEVC with alpha channel). I am sure, that something is wrong with the MP4 file, but I don't understand why it works in Safari on Mac, but doesn't on iPhone. Shouldn't they both play the same File? Here is my workflow: masking the subject in DaVinci Resolve exporting as QuickTime - Apple ProRes 444 - "Export Alpha" using Shutter Encoder (v15.7) to convert the file to H.265 (.mp4) under "Advanced Features": Hardware acceleration to "OSX VideoToolbox" & check "Enable alpha channel" also converting the first file to VP8 (.webm) with "Enable alpha channel" then adding the Videos to the website like this: <video height="450px" autoplay loop muted playsinline disablepictureinpicture> <source src="(url of the mp4)" type='video/mp4; codecs="hvc1"'> <source src="(url of the webm)" type="video/webm"> </video> Here is how it looks on Safari (Mac) This is what it looks like in any browser on iPhone I have re-exported, re-converted and re-implemented it multiple times and I just can't get it to work on iPhone. Does anyone have an idea, what the cause could be, or what I can do differently?
3
0
1.3k
Oct ’24
SIGABRT on WebKit macOS 15.3.2
The application I'm currently working on uses WebKit. Based on the crash analytics, we have noticed that some of our users are experiencing an unusual behavior in the app's WebKit view with macOS 15.3.2. These errors are reported for this version of the OS. The error in the crash log is a SIGABRT error, but there is no relevant information available to address it. In some crash logs, we found this error: "NSInternalInconsistencyException: Returned WKWebView was not created with the given configuration" but there is not any particular way to address it. Is there a way to identify the cause of this error? Alternatively, has anyone encountered this issue and found a solution? OS Version: macOS 15.3.2 (24D81) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Crashed Thread: 0 Application Specific Information: Returned WKWebView was not created with the given configuration. Thread 0 Crashed: 0 CoreFoundation 0x303111e74 __exceptionPreprocess 1 libobjc.A.dylib 0x3027b6cd4 objc_exception_throw 2 CoreFoundation 0x303111d6c +[NSException raise:format:] 3 WebKit 0x34e85cb20 WebKit::UIDelegate::UIClient::createNewPage 4 WebKit 0x34e8a4a80 WebKit::SOAuthorizationCoordinator::tryAuthorize 5 WebKit 0x34e9f04f8 WebKit::WebPageProxy::createNewPage 6 WebKit 0x34ef994c8 WebKit::WebPageProxy::didReceiveSyncMessage 7 WebKit 0x34f0830cc IPC::MessageReceiverMap::dispatchSyncMessage 8 WebKit 0x34ea753b0 WebKit::WebProcessProxy::didReceiveSyncMessage 9 WebKit 0x34f07cfb4 IPC::Connection::dispatchSyncMessage 10 WebKit 0x34f07d3b0 IPC::Connection::dispatchMessage 11 WebKit 0x34f078c50 IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch 12 WebKit 0x34f07f4f4 ***::Detail::CallableWrapper&lt;T&gt;::call 13 JavaScriptCore 0x33f3520c0 ***::RunLoop::performWork 14 JavaScriptCore 0x33f352fe8 ***::RunLoop::performWork 15 CoreFoundation 0x30309f8a0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 16 CoreFoundation 0x30309f834 __CFRunLoopDoSource0 17 CoreFoundation 0x30309f598 __CFRunLoopDoSources0 18 CoreFoundation 0x30309e134 __CFRunLoopRun 19 CoreFoundation 0x30309d730 CFRunLoopRunSpecific 20 HIToolbox 0x319aeb52c RunCurrentEventLoopInMode 21 HIToolbox 0x319af1344 ReceiveNextEventCommon 22 HIToolbox 0x319af1504 _BlockUntilNextEventMatchingListInModeWithFilter 23 AppKit 0x30a7cd844 _DPSNextEvent 24 AppKit 0x30b133c20 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 25 AppKit 0x30a7c0870 -[NSApplication run] 26 AppKit 0x30a797064 NSApplicationMain 27 &lt;unknown&gt; 0x182780274 &lt;redacted&gt; Thread 0 name: t-main-ui Crashed: 0 CoreFoundation 0x303111e74 __exceptionPreprocess 1 libobjc.A.dylib 0x3027b6cd4 objc_exception_throw 2 CoreFoundation 0x303111d6c +[NSException raise:format:] 3 WebKit 0x34e85cb20 WebKit::UIDelegate::UIClient::createNewPage 4 WebKit 0x34e8a4a80 WebKit::SOAuthorizationCoordinator::tryAuthorize 5 WebKit 0x34e9f04f8 WebKit::WebPageProxy::createNewPage 6 WebKit 0x34ef994c8 WebKit::WebPageProxy::didReceiveSyncMessage 7 WebKit 0x34f0830cc IPC::MessageReceiverMap::dispatchSyncMessage 8 WebKit 0x34ea753b0 WebKit::WebProcessProxy::didReceiveSyncMessage 9 WebKit 0x34f07cfb4 IPC::Connection::dispatchSyncMessage 10 WebKit 0x34f07d3b0 IPC::Connection::dispatchMessage 11 WebKit 0x34f078c50 IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch 12 WebKit 0x34f07f4f4 ***::Detail::CallableWrapper&lt;T&gt;::call
3
0
140
Apr ’25
WKWebView Fails with NSURLErrorDomain Code=-1005 on iOS 18.4 Simulator
Hello, I'm experiencing an issue where WKWebView consistently fails to load a specific URL on the iOS 18.4 simulator (Xcode 16.3). The error is as follows: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={ _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4, NSUnderlyingError=Error Domain=kCFErrorDomainCFNetwork Code=-1005, NSErrorFailingURLKey=[REDACTED] } Key Observations: This URL fails consistently only on the iOS 18.4 simulator. The same URL loads without issue in iOS 18.3 and 18.2 simulators. The backend is serving a valid HTTPS certificate chain, and the server appears to be presenting it properly. The same application appears to work on a real iPhone running 18.4. Certificate Chain for the Failing URL Leaf: WR3 (Valid: Mar 17, 2025 – Jun 15, 2025) Intermediate 1: GTS Root R1 (Valid: Dec 13, 2023 – Feb 20, 2029) Intermediate 2: GlobalSign Root CA (Valid: Jun 19, 2020 – Jan 28, 2028) Other URLs Work Fine in iOS 18.4 Simulator WKWebView successfully loads the following URLs with similar or more complex certificate chains: https://google.com → WR2, GTS Root R1, GlobalSign Root CA https://amazon.com → DigiCert Global CA G2, DigiCert Global Root G2, VeriSign G5 https://stackoverflow.com → E5, ISRG Root X1 https://shopify.com → GlobalSign Root CA, GTS Root R4, WE1 This suggests the issue may not be with general network or certificate trust but instead something specific about how iOS 18.4 handles this domain or certificate configuration in the simulator. Any insights on how to solve this would be greatly appreciated.
1
0
198
Apr ’25
declarativeNetRequest.getMatchedRules() returns blocked URLs for past 5 minutes instead of current webpage URLs.
We are using declarativeNetRequest.getMatchedRules() to get the matched rules' URLs. When user switches website in the same tab, it returns URLs which were blocked in the previous website also, within past 5 minutes. Is it possible to fetch getMatchedRules() only for current webpage in the same tab?
1
0
603
Oct ’24
Authentication for Safari Web Extensions
My Safari Web Extension got rejected with the following reason: "Guideline 4.0 - Design The user is taken to a new Safari window or tab to sign in or register for an account, which provides a poor user experience." Is this right? First of all Design guide line 4.0 does not seem to mention antyhing about this topic. Second, I've seen many, many web extensions that opens a new tab to let you sign in or register. Including top recommended ones like Grammarly, PayPal Honey and Pocket. The review also mentions: It is acceptable to take users to the default web browser for some sign in or account registration options if ASWebAuthenticationSession is used for the session. That does not seem right either, since that is primarily designed for native apps. I'm pretty sure the extensions I've tried that open a tab for authentication does not use that. It is like my Safari Web Extension is being reviewed like a Mac OS app. What am I'm doing wrong?
1
0
461
Nov ’24
Safari Content Blocker - cannot set bundle name in Safari Extensions list
Hello, I can't figure out how to set the name of a Content Blocker in the Safari extensions list. So far, the Content Blocker name in this list is the Contaning application name. I tried to set the bundle name in Info.plist and tried to locate Info.plist, without success... Since I also bundle a Safari ("chrome") extension, I have two extensions in the list, and it would be fine to display a specific name for each to make it clear for the user.
3
0
639
Oct ’24
WkWebView breaks with isElementEnabled preference set to true on fullscreen pause
I have an webview that loads videos in it, we would like to be able to fullscreen our videos, so we use the fullscreen preference in the documentation however when it is set to true, upon fullscreening a video then pausing it, the entire video player will disappear. You can exit fullscreen and attempt to fullscreen the video player once again, however upon doing this the entire app view will now disappear and you'll see your desktop background (or whatever is currently behind your app). This behavior seems consistent across multiple websites with the current app. I have setup a sample project you can test here The Main error that seems to trigger to the console is this. I have not been able to find a solution to, maybe I am simply missing something here. I am on Sequoia 15.2 for Mac. Attempting to update all DD element frames, but the bounds or contentsRect are invalid. Bounds: X: 0.00 Y: 0.00, W: 0.00 H: 0.00, contentsRect: X: 0.00 Y: 0.00, W: 1.00 H: 1.00 , skipping
2
0
703
Nov ’24
Safari tabs sync doesn't work
Hello, I'm facing the issue of not working sync of Safari tabs across my devices. I'm currently on macOS 15.2 Public Beta and iOS 18.2 Public Beta and sync still doesn't work. When I try to turn it off on all devices and set-up again it starts working and sync properly but only one time, than again stop working properly. It's also described here as an issue: https://discussions.apple.com/thread/255767048?sortBy=rank
Topic: Safari & Web SubTopic: General
2
0
415
Nov ’24
WKWebView process did become unresponsive in iOS 17
Recently, we ran into a bit of a problem when using WKWebView. Sometimes, problems with all pages blank occur which use WKWebView. I implemented WKNavigationDelegate and found that it stops at - (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler and it won't call below func forever - (void)webView:(WKWebView*)theWebView didStartProvisionalNavigation:(WKNavigation*)navigation I suspected that the render process is terminated and it won't restart. Then i try to resolve this problem by call reload func [self.webView reload]; But it didn't work. In The Meanwhile, i got some error message in console I have tested it in iOS 16 and 17. only iOS 17 got the issue. Pray for some help. Thanks a lot.
1
0
748
Oct ’24
declarativeNetRequest.getMatchedRules() not working on iOS 18 Safari
declarativeNetRequest.getMatchedRules() gives us the below error: Error retrieving tabs or matched rules: – Error: Invalid call to declarativeNetRequest.getMatchedRules(). The 'activeTab' permission has not been granted by the user for the tab. We have added the "activeTab" permissions in the manifest (version 2). And in the device Safari extension settings we see that user has given permission as "allow".
2
0
779
Sep ’24
What makes Safari render an active extension's icon in color in the toolbar?
Sometimes Safari is rendering the icon for an active extension in its original provided colored representation, other times Safari is applying an overlay color in line with the system's highlight color. This difference can even be seen seen on the Safari Extensions Developer home page: https://developer.apple.com/safari/extensions/images/extensions-hero-large_2x.png You will notice that Grammarly's icon is shown in it's original color format, while the others aren't. Example of extensions where the icon is shown in color: Bitwarden Grammarly 1Password Consent-O-Matic I've compared the source code of Bitwarden and Consent-o-Matic with my own extension and cannot find any differences in the settings or image properties (resolution, DPI, file type, color profile). If I take the exact PNG source files from said open source extensions and replace them in my own source code, these icons show up in full color. Does this perhaps mean there is a bug in Safari's processing of the icons where it fails to overlay the icon with the highlight color in some cases? I and I assume many developers with me would like to understand what determines this difference. Ideally, there is a consistent UX where the end user has the choice between icons in color or highlight color overlay.
3
0
1.1k
Mar ’25
Issues with Displaying Language Tags Compliant with RFC 5646
Hello, I'm currently facing some issues with localization for the Safari extension on iOS: Issues with Language Tags: Folder names like pt-BR (Brazilian Portuguese) and pt-PT (European Portuguese) placed in the Resources/_locales/ directory are not displaying the respective languages correctly; instead, the default English is shown. Similarly, using folder names like zh-CN (Simplified Chinese) and zh-TW (Traditional Chinese) also results in default English display instead of the intended Chinese language. Conversely, when changing the folder names to pt (Portuguese general) and zh (Chinese general), the languages display correctly. Could you please provide any recommendations or tips regarding language tag settings and how to ensure they are properly recognized according to RFC 5646? Thanks for your help! Best,
5
0
1.4k
Oct ’24