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

WebKit Documentation

Posts under WebKit tag

274 Posts
Sort by:
Post not yet marked as solved
0 Replies
197 Views
Is there any reference/documentation/discussion about the motivation for including the WKWebView loadSimulatedRequest() method? Is it intended to be used for testing? Page load performance enhancement? I'm wondering if there is a way to leverage its usage in our webview dependent app.
Posted Last updated
.
Post not yet marked as solved
0 Replies
164 Views
Is it possible to generate pdf data from a html content, including the background graphics (background color, box shadow, etc..) ? Right now, I can only make a pdf view from the apple website like this: It can be seen that the background images and colors are missing.
Posted Last updated
.
Post not yet marked as solved
0 Replies
281 Views
Since iOS 17.4 when open a camera in Safari, video stop when download popup appear and video doesn't restart expect when go to home menu and reopen Safari This comportment wasn't present before 17.4 To Reproduce : https://zcqqjd.csb.app/ Step 1 : Click on start Camera Step 2 : Click on Download Picture
Posted
by Adrien-M.
Last updated
.
Post not yet marked as solved
0 Replies
260 Views
Our app uses Azure B2C for SSO login, and we are noticing a bug on Safari 17.x (any browser on iOS 17.x, and Safari 17 on Mac OS) where the Azure B2C cookies go missing during the registration process, which leads to a broken user experience. The following cookies are the ones that go missing The only forum posts related to this issue I have come across are these: https://techcommunity.microsoft.com/t5/azure/azure-app-on-ios-17-not-working/m-p/3958809 Which links to this https://techcommunity.microsoft.com/t5/intune-customer-success/day-zero-support-for-ios-ipados-17-and-macos-14/ba-p/3930010 Is this in bug that will be fixed in an upcoming release on Safari 17.x?
Posted Last updated
.
Post not yet marked as solved
0 Replies
156 Views
How exactly am I supposed to implement the following delegate method of WKWebView? func webView(_ webView: WKWebView, showLockdownModeFirstUseMessage message: String, completionHandler: @escaping (WKDialogResult) -> Void) The problem: the delegate method is defined to be available since iOS 13. But "WKDialogResult" in the completion handler is declared to be available since iOS 16. So this is already very odd and probably a bug in the API declaration. When I make the delegate method available since iOS 16 (via @available (iOS 16.0,*)) then Xcode gives me an error stating that this method must be provides for iOS 14 and later. But when it is made available since iOS 14 (or 13), then I get the error that WKDialogResult is only available since iOS 16. So this looks like a big messy bug in the API declaration, or did I miss something here? It would not the first bug in the API declaration of the WKWebView where the availability is wrong (for example the property "upgradeKnownHostsToHTTPS" is declared to available since iOS 14.5, but in reality it is only available since iOS 16 and would crash when used under iOS 14.5)
Posted Last updated
.
Post not yet marked as solved
1 Replies
206 Views
My videos have stopped loading on canvas after the iOS 17.4 update. I tried partially loading the videos instead of loading them entirely and it works on safari but not on chrome. Any ideas on how I can fix this issue? What is the recommended way of loading videos on canvas for browsers on iOS?
Posted Last updated
.
Post not yet marked as solved
0 Replies
283 Views
In my app, I have several WKWebViews. The WKWebViews communicate to javascript by installing userscripts. Now one of those webviews, wants to enable support for service workers, which is not required in the other instances of WKWebView. So what I thought, is that I only enable in this WKWebView instance the service worker, which sets limitsNavigationsToAppBoundDomains in its WKWebViewConfiguration to true. And so the service worker is enabled and works fine and also my WKUserScript works fine. In the other WKWebView instances I thought, that I would simply set limitsNavigationsToAppBoundDomains to false and the service worker would be disabled and WKAppBound domains from the Info.plist would be ignored. Unfortunately my WKUserScript now stopped working. :-( How can I achieve that? Does the presence of WKAppBound domains in the Info.plist mean, that I MUST set limitsNavigationsToAppBoundDomains to true for my WKUserScript to work? Or am I on the completely wrong track? Any help is greatly appreciated, because I am pretty much stuck with this issue and I need to solve it, because the limitation to 10 domains from WKAppBoundDomains carries the risk to break the webview. In that webview payment is provided and the payment provider might at any time change dependencies to another domain (as happened recently, which broke the payment page) Best regards Alex
Posted
by AlexMCC.
Last updated
.
Post not yet marked as solved
0 Replies
190 Views
Hello, my radio streaming app worked well in iOS 17.2 and earlier but from iOS 17.4 streaming no longer works, what has changed? What do I have to do in my app? import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { @IBOutlet weak var mWebView: WKWebView! private let url: URL = URL(string: "https://mi web")! override func viewDidLoad() { super.viewDidLoad() let configuration = WKWebViewConfiguration() // Configurar preferencias de la página web let preferences = WKPreferences() preferences.javaScriptEnabled = true configuration.preferences = preferences mWebView.navigationDelegate = self mWebView.load(URLRequest(url: url)) } }
Posted
by ovidaniel.
Last updated
.
Post not yet marked as solved
0 Replies
304 Views
Even when iOS's '"." Shortcut' keyboard setting is enabled, double-tapping the spacebar in WKWebView doesn't insert a period. While making WKWebView editable , "." shortcut is not working. It works fine when any other external keyboard is used. I am facing this issue in WKWebView using apple keyboard. Even forceful adding javascript to replace double tap of space bar to period character logic is not working.
Posted
by Neel95.
Last updated
.
Post not yet marked as solved
0 Replies
201 Views
Problem: Hello! I have some problems with UIEditMenuInteraction in WKWebView which show PDF using PDFKit (as far as I know) - when text is selected, there is no copy/paste buttons on iOS 16.4 or higher. Also I've noticed that selection blue view take less space than actual text is on iOS 17. The problem both cyrillic and latin characters. How I can fix this? p.s. I found on stackoverflow that PDFKit can treat PDF files like images, but on view hierarchy there is no differences between 16 and 17 iOS How it looks: The problem file: https://drive.google.com/file/d/1Tu8RCrlwOI_H3TcwOGFbDR0G9h1OP7MU/view?usp=sharing
Posted
by whitegap.
Last updated
.
Post not yet marked as solved
0 Replies
182 Views
In Android there's a helpful feature in webview to load local files in assets folder as https to comply with same origin content policy (https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) Is there anything equivalent in WKWebView? I've been looking it up for a while and couldn't find anything conclusive. Thank you.
Posted
by JBsnaf.
Last updated
.
Post not yet marked as solved
0 Replies
559 Views
Since the release of Xcode 15, my tests aren't functioning on Xcode Cloud. The login screen, which is a web view, isn't loading correctly during the Xcode Cloud UI tests, as depicted in the screenshot below: Any insights on what might be causing this error? We haven't made any changes to this feature, and it operates smoothly locally.
Posted Last updated
.
Post not yet marked as solved
0 Replies
301 Views
I'm migrating a macOS application from the old and deprecated WebView to the new and sparkly WKWebView. It seems to work fine, but four error messages appear in the console (see below) just after the dialog is closed. I searched. It seems this issue can be fixed through the addition of a target entitlement called Background Modes. This particular capability is however not listed by Xcode, so I can't add it. I think this is because we're targeting macOS and not iOS, but I'm not certain. Stuck. Tips and advice appreciated! Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> 0x2c40246c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=66538, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> 0x2c4024720 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'GPUProcess Background Assertion' for process with PID=66540, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} Deployment target is 10.15, Xcode version is 15.3.
Posted
by pelle_se.
Last updated
.
Post not yet marked as solved
0 Replies
326 Views
Hi, We have recently observed that support for PWAs has been ended in the EU region in iOS 17.4. The changes were visible while the OS was in beta as well. We have a web app with our user base in the US. Is there any plan for these restrictions to be implemented in any other region?
Posted Last updated
.
Post not yet marked as solved
0 Replies
307 Views
I'm currently using a WKWebView to load certain types of documents via loadRequest, but I've recently been running into an issue with .doc files doing this: static NSString *customScheme = @"customscheme"; @interface WordDocWKSchemeHandler : NSObject <WKURLSchemeHandler> @end @implementation WordDocWKSchemeHandler { NSData *_data; NSString *_mimeType; } - (instancetype)initWithData:(NSData*)data mimeType:(NSString*)mimeType{ self = [super init]; if (self) { _data = data; _mimeType = mimeType; } return self; } - (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask { NSURL *url = urlSchemeTask.request.URL; if (![url.scheme isEqualToString:customScheme]){ return; } NSURLResponse *response = [[NSURLResponse alloc] initWithURL:url MIMEType:_mimeType expectedContentLength:_data.length textEncodingName:@""]; [urlSchemeTask didReceiveResponse:response]; [urlSchemeTask didReceiveData:_data]; [urlSchemeTask didFinish]; } - (void)webView:(WKWebView *)webView stopURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask{ //empty } @end - (void)_setupWebViewPropertiesAndConstraints{ _webView.navigationDelegate = self; _webView.hidden = YES; [self.view addConstrainedSubview:_webView]; [self.view addConstraints:[_webView constraintsForFillingSuperview]]; self.container.showsLoadingIndicator = YES; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; WKWebViewConfiguration *docConfig = [WKWebViewConfiguration new]; WordDocWKSchemeHandler *schemeHanlder = [[WordDocWKSchemeHandler alloc] initWithData:_content.data mimeType:_content.contentType]; [docConfig setURLSchemeHandler:schemeHanlder forURLScheme:customScheme]; //Setup webview with custom config handler _webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:docConfig]; [self _setupWebViewPropertiesAndConstraints]; NSURL *customURL = [NSURL URLWithString:[NSString stringWithFormat:@"\%@:/",customScheme]]; [_webView loadRequest:[NSURLRequest requestWithURL:customURL]]; } The mimeType is correctly being resolved to "application/msword" but any time we try to load this the navigation fails: -(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { The error message here is OfficeImportErrorDomain Code=912. I've tried this on both a simulator and actual device on iOS 17 and 16 and this always fails. I've also tried turning the data into a base64 string and loading it that way and this also fails. Any advice here would be appreciated. It seems like this used to work at some point but no longer works.
Posted Last updated
.
Post not yet marked as solved
1 Replies
473 Views
Hi Apple Team, we are observing following error intermittently when trying to playback FairPlay protected HLS streams. The error happens immediately after loading the certificate. Playback with same certificate on same device(Mac, iPhone) works most of time but intermittently this error is observed with following codes. The code=6 means MEDIA_KEYERR_DOMAIN but I did not find any information on what does systemCode=4294955417 mean? Is there a way to check what does this system code mean and what could be causing this intermittent behaviour? { "code": 6, "systemCode": 4294955417 }
Posted Last updated
.
Post not yet marked as solved
0 Replies
448 Views
Xcode 15.3 build with device(iPhone 12 / iOS 17.4) var webView: WKWebView = { let view = WKWebView(frame: .zero, configuration: WKWebViewConfiguration()) return view }() Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1a049fa48) Hello. Also in Firebase too. At first I thought it was a Firebase issue. https://github.com/firebase/firebase-ios-sdk/issues/12485 But there seems to be a problem with iOS 17.4. There is no problem when running the app after disconnecting. Thanks for attention.
Posted
by yyyng.
Last updated
.
Post not yet marked as solved
3 Replies
842 Views
We have an angular/ionic based app that has an audio playback feature. It appears that iphone (but not ipad) users who upgrade to iOS 17.4 can no longer play audio in our app. iPad users who upgraded to 17.4 don't have an issue. We use the HTMLAudioElement for audio playback. It appears that in 17.4 it is no longer firing the 'canplay' event that we listening for, for starting our playback. The other data buffering events like 'loadeddata' are also not being delivered. By changing the logic to listen for the 'loadstart' event, audio playback works and then the remaining 'canplaythrough' and 'canplay' are delivered. In other words, I need to start playback before any data buffering status events are delivered, otherwise they never get delivered. I am testing this against an audio delivery server on my same machine and have confirmed that the data is correctly delivered. Is anyone else experiencing a similar issue on iphones in iOS 17.4?
Posted
by drjvp.
Last updated
.