Display web content in windows and implement browser features using WebKit.

Posts under WebKit tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

SIGABRT on WebKit on iOS 17
The application that I'm working on uses WebKit. I'm facing a strange behavior in the app with iOS 17, in which errors are being reported only for this OS version. It is a SIGABRT error, but there is no relevant information on it to work on. SIGABRT: 0 libsystem_kernel.dylib +0xa01c ___pthread_kill 1 libsystem_pthread.dylib +0x567c _pthread_kill 2 libsystem_c.dylib +0x75bac _abort 3 libc++.1.dylib +0x21bb0 std::__1::__libcpp_verbose_abort(char const*, ...) 4 WebKit +0x5b7ed8 WebKit::ProcessThrottler::sendPrepareToSuspendIPC(WebKit::IsSuspensionImminent) 5 WebKit +0x5b71d0 WebKit::ProcessThrottler::removeActivity(WebKit::ProcessThrottlerActivity&) 6 WebKit +0x20dae8 WebKit::ProcessThrottlerActivity::~ProcessThrottlerActivity() 7 WebKit +0x20da80 std::__1::unique_ptr<WebKit::ProcessThrottlerActivity, std::__1::default_delete<WebKit::ProcessThrottlerActivity> >::reset[abi:v160006](WebKit::ProcessThrottlerActivity*) 8 WebKit +0x5a0d9c ***::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(***::UniqueRef<IPC::Encoder>&&, ***::OptionSet<IPC::SendOption>, std::__1::optional<IPC::ConnectionAsyncReplyHandler>, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_5, void, IPC::Decoder*>::~CallableWrapper() 9 WebKit +0xac1524 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) 10 WebKit +0xac1868 IPC::Connection::dispatchIncomingMessages() 11 JavaScriptCore +0x4fe10 ***::RunLoop::performWork() 12 JavaScriptCore +0x50ce0 ***::RunLoop::performWork(void*) 13 CoreFoundation +0x37ac8 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 14 CoreFoundation +0x36d44 ___CFRunLoopDoSource0 15 CoreFoundation +0x354f8 ___CFRunLoopDoSources0 16 CoreFoundation +0x34234 ___CFRunLoopRun 17 CoreFoundation +0x33e14 _CFRunLoopRunSpecific 18 GraphicsServices +0x35e8 _GSEventRunModal 19 UIKitCore +0x22f2f8 -[UIApplication _run] 20 UIKitCore +0x22e934 _UIApplicationMain 21 *** +0xd0c4 main (main.m:15:10) 22 dyld +0x5d40 start This error is not occurring on iOS 16 or less. Is there a way to find the reason for this error? Or has anyone faced it and could solve it?
4
0
524
Oct ’23
WKWebView -requestMediaPlaybackStateWithCompletionHandler: Reporting Incorrect Playback State?
So I have a WKWebView with a loaded page. This page is playing an embedded Youtube video. The playback state is WKMediaPlaybackStatePlaying. All good. Then I click a link on the page (navigation jumps to a new page) and the video is no longer playing. No video or audio. The navigationDelegate calls -webView:didFinishNavigation: And my navigationDelegate call -requestMediaPlaybackStateWithCompletionHandler: on the webview from within -webView:didFinishNavigation: And in the completion handler of -requestMediaPlaybackStateWithCompletionHandler: the playback state is WKMediaPlaybackStatePlaying but nothing is playing because we are on a new page.... I even tried calling -requestMediaPlaybackStateWithCompletionHandler: after a delay but that doesn't seem to make a difference (even gave it a delay as long as 5 seconds)
4
0
597
Oct ’23
IOS - WebView - "Hide My IP" and "PopUp"
I have the following situation: I am trying to access a page that I can only access after we have logged in with the Microsoft 2FA auth. I always got the same error "415 Unsupported Media Type" in the Safari browser. After I had deactivated "Block POP" in the Safari settings and set "Hide my IP" to OFF, everything worked fine in the Safari browser. Now I am trying the same thing in my app in the WebView. I have already tried this code: import UIKit import SafariServices class HorizonViewController: UIViewController, SFSafariViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() showWebPage() } func showWebPage() { if let url = URL(string: "https://myurl") { let safariVC = SFSafariViewController(url: url) safariVC.delegate = self self.present(safariVC, animated: true, completion: nil) } } // Optional: SafariViewController Delegate Methoden func safariViewControllerDidFinish(_ controller: SFSafariViewController) { // Wird aufgerufen, wenn der Benutzer den SafariViewController schließt controller.dismiss(animated: true, completion: nil) } // Sie können hier weitere Delegate-Methoden hinzufügen, falls Sie sie benötigen. } an also this code: import UIKit import WebKit class HorizonViewController: UIViewController, WKNavigationDelegate, WKUIDelegate { var webView: WKWebView! override func loadView() { // Erstellen einer Web-Konfiguration let webConfiguration = WKWebViewConfiguration() // Deaktivieren des Cross-Site-Trackings webConfiguration.websiteDataStore = WKWebsiteDataStore.nonPersistent() // Erstellen der WebView mit der obigen Konfiguration webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.navigationDelegate = self webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad() if let url = URL(string: "https://glavid.golav.lu/") { var request = URLRequest(url: url) request.setValue("application/json", forHTTPHeaderField: "Accept") webView.load(request) } } // MARK: - WKNavigationDelegate // Optional: Hier können Sie die Navigation im WebView steuern // MARK: - WKUIDelegate func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? { if navigationAction.targetFrame == nil { webView.load(navigationAction.request) } return nil } } Unfortunately, I get the same error 415 after the 2FA.
0
0
311
Oct ’23
WKWebView UIDelegate Methods Not Being Called on Mac Catalyst (WKUIDelegate)
I have a WKWebView that sets the UIDelegate: self.webView.UIDelegate = self; The following methods are never called when I right click in the WKWebView to being up a context menu: -(void)webView:(WKWebView*)webView contextMenuForElement:(WKContextMenuElementInfo*)elementInfo willCommitWithAnimator:(id <UIContextMenuInteractionCommitAnimating>)animator -(void)webView:(WKWebView*)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo*)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler - (void)webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo; This is from a Mac Catalyst app (I'm on macOS 14.0 23A344)
4
0
602
Oct ’23
WKWebView can not load "https://www.baidu.com"
I created an WKWebView, but it can not load "https://www.baidu.com" and also it keeps calling decidePolicyForNavigationAction function it works well for other website @interface ViewController() @property (nonatomic, strong) WKWebView* webview; @end @implementation ViewController (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.webview = [[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 500, 500)]; [self.view addSubview:self.webview]; self.webview.navigationDelegate = self; NSURL* url = [NSURL URLWithString:@"https://www.baidu.com"]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; [self.webview loadRequest:request]; // [self.webview reload]; } (void)setRepresentedObject:(id)representedObject { [super setRepresentedObject:representedObject]; // Update the view, if already loaded. } (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler{ decisionHandler(WKNavigationActionPolicyAllow, preferences); }
0
0
274
Oct ’23
iOS 17 WebRTC bug keyFramesDecoded > 0 while framesDecoded == 0
Hi Folks, Our WebRTC based application has seen an increase in failed sessions after the iOS 17 update. After some debugging we noticed that on iPhone for all failure sessions the number of keyFramesDecoded is > 0 while the number of framesDecoded == 0. According to the WebRTC standard this should not be possible: "This is a subset of framesDecoded. framesDecoded - keyFramesDecoded gives you the number of delta frames decoded.", so this seems to be a bug in the Safari WebRTC implementation on iOS17.
1
0
581
Oct ’23
iPhone 14 Pro + iOS 17.0.2. Cookies are not getting added to Web Requests
iPhone 14 Pro + iOS 17.0.2. Cookies are not getting added to Web Requests On the above device model, cookies stored in WKWebCookieStore are not automatically added to web view requests. This bug is happening only after upgrading the device to iOS 17.0.2 on my iPhone 14 pro. Other devices with same OS version are not having this issues. Anyone has faced this issue and possible solve for this?
0
0
240
Oct ’23
iOS App continually crashing for out of memory errors, anyone got any advice?
I have a hybrid iOS app that continually is crashing, I have posted a crash report for this issue before. It appears to be happening when it is trying to save data to storage, it is taking all the data and attempting to convert a large object to a JSON string with the built in javascript Stringify method. Is there anything that sticks out to anyone? Original app name is redacted. Crash_Report.txt
1
0
514
Oct ’23
NSToolbar Draws On Top of "Full Screen" Video Played in WKWebView in Mac Catalyst app
I have a Mac Catalyst app configured like so: The root view controller on the window is a tripe split UISplitViewController. The secondary view controller in the Split View controller is a view controller that uses WKWebView. Load a website in the WKWebview that has a video. Expand the video to “Full screen” (on Mac Catalyst this is only “Full window” because the window does not enter full screen like AppKit apps do). The NSToolbar overlaps the “Full screen video.” On a triple Split View controller only the portions of the toolbar in the secondary and supplementary columns show through (the video actually covers the toolbar area in the “primary” column). The expected results: -For the video to cover the entire window including the NSToolbar. Actual results: The NSToolbar draw on top of the video. -- Anyone know of a workaround? I filed FB13229032
0
0
430
Oct ’23
WKWebView Unrecognized Selector Sent to Instance: WebAVPlayerLayer - startRedirectingVideoToLayer:forMode:
I'm using WKWebView in a Mac Catalyst app (not sure if using Catalyst makes a difference but it seems WKWebView doesn't get the "full" Mac version AppKit apps do so maybe it does). When a website has a video playing and if I click the button that I guess is a Picture in Picture button next to the "close" button the web kit process gets an unrecognized selector sent to instance exception. -[WebAVPlayerLayer startRedirectingVideoToLayer:forMode: <-- Unrecognized selector. In debugging mode at least my app doesn't crash the video continues to play and the WKWebview is unresponsive to user interaction. I have to force quit my app. -- I'm on Sonoma 14.0
1
1
463
Oct ’23
WKWebView not loading content in macOS Sonoma
I had a Mac app in the App Store but I have had to remove it since it stopped working in Sonoma. It will not load content in the WKWebView giving this error in the console. It has worked for several years... 0x111000c00 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch) 0x111000c00 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason=Crash 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: Not eagerly reloading the view because it is not currently visible 0x110030a00 - NetworkProcessProxy::didClose (Network Process 0 crash) ProcessAssertion::remainingRunTimeInSeconds failed to get handle for process with PID=22.500 0x111000000 - [PID=22.501] WebProcessProxy::didClose: (web process 0 crash) 0x111000000 - [PID=22.501] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash 0x110020a20 - ProcessAssertion: Failed to acquire RBS IndefiniteBackground assertion 'XPCConnectionTerminationWatchdog' for process because PID 0 is invalid 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::processDidTerminate: (pid 22.501), reason=Crash 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::dispatchProcessDidTerminate: reason=Crash 0x13402ce18 - [pageProxyID=6, webPageID=7, PID=22.501] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 0x1100008b0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'Jetsam Boost' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 0x110020900 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'NetworkProcess Foreground Assertion' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 0x110000900 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'Jetsam Boost' for process with PID=22.501, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 0x110020960 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Foreground Assertion' for process with PID=22.501, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}> 0x1100209c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'NetworkProcess Background Assertion' for process with PID=22.500, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist} 0x110020a20 - ProcessAssertion::acquireSync Failed to acquire RBS asser Can anyone give me a hint to where to look
4
0
1.8k
Oct ’23
UIDatePicker CALayerInvalidGeometry crash iOS17
Started getting this error on iOS 17 Using "input type =MONTH" at WKWebView. Any Ideas? Fatal Exception: CALayerInvalidGeometry CALayer bounds contains NaN: [0 0; 334 nan]. Layer: <CALayer:0x28275dec0; position = CGPoint (96.5 149); bounds = CGRect (0 0; 0 0); delegate = <_UIDatePickerOverlayPlatterView: 0x1217270b0; frame = (96.5 149; 0 0); transform = [0, 0, 0, 0, 0, 0]; layer = <CALayer: 0x28275dec0>>; sublayers = (<CALayer: 0x28275ea80>, <CALayer: 0x28275fe40>); opaque = YES; transform = CATransform3D (0 0 0 0; 0 0 0 0; 0 0 1 0; 0 0 0 1)> Fatal Exception: CALayerInvalidGeometry 0 CoreFoundation 0xed5e0 __exceptionPreprocess 1 libobjc.A.dylib 0x2bc00 objc_exception_throw 2 CoreFoundation 0x1723a4 -[NSException initWithCoder:] 3 QuartzCore 0x2fef0 CA::Layer::set_bounds(CA::Rect const&, bool) 4 QuartzCore 0x2fdf8 -[CALayer setBounds:] 5 UIKitCore 0x63d58 -[UIView _backing_setBounds:] 6 UIKitCore 0x62878 -[UIView(Geometry) setBounds:] 7 UIKitCore 0x11aa910 -[_UIDatePickerOverlayPresentation _presentNewDatePicker:] 8 UIKitCore 0x11a9b78 __64-[_UIDatePickerOverlayPresentation presentDatePicker:onDismiss:]_block_invoke 9 UIKitCore 0x11aa5a8 __81-[_UIDatePickerOverlayPresentation _prepareDatePickerPresentationWithCompletion:]_block_invoke 10 UIKitCore 0x1298f0 -[UIPresentationController transitionDidFinish:] 11 UIKitCore 0x6cc1f8 -[_UICurrentContextPresentationController transitionDidFinish:] 12 UIKitCore 0x1293ac __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.111 13 UIKitCore 0x1291d8 -[_UIViewControllerTransitionContext completeTransition:] 14 UIKitCore 0xab924 -[_UIAfterCACommitBlock run] 15 UIKitCore 0xab708 -[_UIAfterCACommitQueue flush] 16 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release 17 libdispatch.dylib 0x4300 _dispatch_client_callout 18 libdispatch.dylib 0x12998 _dispatch_main_queue_drain 19 libdispatch.dylib 0x125b0 _dispatch_main_queue_callback_4CF 20 CoreFoundation 0x379bc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 21 CoreFoundation 0x346c8 __CFRunLoopRun 22 CoreFoundation 0x33e18 CFRunLoopRunSpecific 23 GraphicsServices 0x35ec GSEventRunModal 24 UIKitCore 0x22f350 -[UIApplication _run] 25 UIKitCore 0x22e98c UIApplicationMain
0
0
369
Sep ’23
Sign in with Apple - Supporting hardware key (YubiKey) based login through WKWebView
I want to support "Sign in with Apple" for my macOS application. Currently, I'm using WKWebview to support this. I'm able to provide a sign in for the current mac user correctly. But some users try to login with another apple ID, which has FIDO certified keys added as 2FA. Now my WKWebView shows this : But nothing happens when they click on "Continue". I think I need to create some kind of interface in my application for this case, but no clear idea. I can't see much articles for this use case with security keys. Anybody has any idea ?
2
0
571
Sep ’23
Change mobile data transfer
My APP is hybrid architecture, I transferred my test phone to a new phone, userdefault will be transferred, but the local storage of the front-end will not be transferred. Both(userdefault&amp;local storage) will be transferred when my colleagues transfer their personal phones. My test case Same model mobile phone Mobile phones with the same OS version Switch from a small OS version to a phone with a large OS version Switch from large OS version to mobile phone with small OS version The first three items are userdefault will be transferred, but local storage will not be transferred. The fourth item is that you will be asked to upgrade the OS version when transferring. Does anyone know any relevant information? Or are there any settings enabled?
0
0
271
Sep ’23