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

WebKit Documentation

Posts under WebKit tag

280 Posts
Sort by:
Post not yet marked as solved
7 Replies
1.1k Views
From Xcode15, when Download Container in Window > Devices and Simulators for iPadOS17, an error occurs. The specified file could not be transferred. Domain: com.apple.dt.CoreDeviceError Code: 7000 User Info: { DVTErrorCreationDateKey = "2023-11-21 05:52:37 +0000"; NSURL = "file:///Users/administrator/Desktop/<bundle identifer>%202023-11-21%2014:52.14.006.xcappdata/AppData/Library/WebKit/WebsiteData/IndexedDB/v0"; } -- Performing a file system operation failed: Failed to open Library/WebKit/WebsiteData/IndexedDB/v0 for reading, openat(2) returned POSIX error code 62 (parentParam = 51) Domain: com.apple.dt.remoteservices.error Code: 11001 -- Failed to open Library/WebKit/WebsiteData/IndexedDB/v0 for reading, openat(2) returned POSIX error code 62 (parentParam = 51) Domain: NSPOSIXErrorDomain Code: 62 Failure Reason: Too many levels of symbolic links -- System Information macOS Version 14.0 (Build 23A344) Xcode 15.0.1 (22266) (Build 15A507) indexedDB is not used in the app. I was able to download successfully with Xcode15 and iPadOS16. I was able to download successfully with Xcode14 and iPadOS17. Why do I get an error with Xcode15 and iPadOS17?How should I fix it? That you.
Posted
by oohashi.
Last updated
.
Post not yet marked as solved
0 Replies
74 Views
I am currently developing an iOS app that needs to embed a third-party website. On this website, the best view is achieved in the standard Safari app by pressing the 'Aa' button on the left side of the address bar and setting the zoom to 50%. I want to replicate this 50% scaling in WKWebView, but I'm not sure how to accomplish it. I've tried using webView.pageZoom = 0.5 and setting webView.scrollView.minimumZoomScale = 0.5 webView.scrollView.maximumZoomScale = 0.5 but it doesn't display the same way as it does in Safari. How can I achieve the same scaling effect in WKWebView?
Posted
by Ru1x.
Last updated
.
Post not yet marked as solved
9 Replies
168 Views
In iOS version 17.4 and above, we have observed that the following code works fine upon the initial opening. However, after minimizing the page and reopening it, there is a chance of encountering issues with abnormal lines. Please note the reproduction conditions: try minimizing the page, opening other apps, and then reopening it multiple times. The code is in the comments section. first time: After minimizing and reopening...
Posted
by meloseven.
Last updated
.
Post not yet marked as solved
4 Replies
436 Views
Crash condition: when I update the Xcode version to 15.3 and run the iPhone to load the app on debug mode with the following diagnosing setting: Hardware Model: iPhone 14 pro Role: Foreground Date/Time: 2024-03-08 11:30 -0800 Launch Time: 2024-03-08 11:30 -0800 OS Version: iPhone OS 17.4(21E219) Exception Type: EXC_BREAKPOINT Exception Codes: (code=1, subcode=0x19b1eba48) Exception Note: EXC_BREAKPOINT Triggered by Thread: 1 Thread 1 Queue : com.apple.main-thread (serial) #0 0x000000019b1eba48 in xzm_malloc_zone_free_slow.cold.1 () #1 0x000000019b1e28d0 in xzm_malloc_zone_free_slow () #2 0x00000001a25ef1c8 in pas_try_deallocate_slow_no_cache () #3 0x00000001a10d32f8 in ***::String::String(__CFString const*) () #4 0x00000001a0494ab8 in WebKit::isFullWebBrowserOrRunningTest() () #5 0x00000001a09e1520 in WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration(WebKit::IsPersistent, WebKit::WebsiteDataStoreConfiguration::ShouldInitializePaths) () #6 0x00000001a09d3ae0 in WebKit::WebsiteDataStore::defaultDataStore() () #7 0x00000001a05bc5e8 in +[WKWebsiteDataStore defaultDataStore] () #8 0x00000001a05b6624 in -[WKWebViewConfiguration websiteDataStore] () #9 0x00000001a0576850 in -[WKWebView _initializeWithConfiguration:] () #10 0x00000001a0577e04 in -[WKWebView initWithFrame:configuration:] () #11 0x0000000104cbf724 in -[AAChartView initConfigurationWithFrame:] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitLib/AAChartCreator/AAChartView.m:133 #12 0x0000000104cbf4e8 in -[AAChartView initWithFrame:] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitLib/AAChartCreator/AAChartView.m:115 #13 0x0000000104c133a4 in -[BasicChartVC setupAAChartView] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:99 #14 0x0000000104c13208 in -[BasicChartVC drawChart] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:86 #15 0x0000000104c12f9c in -[BasicChartVC viewDidLoad] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:66 #16 0x000000018d4e530c in -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] () #17 0x000000018d29bfb4 in -[UIViewController loadViewIfRequired] () #18 0x000000018d29a7a8 in -[UIViewController view] () #19 0x000000018d98a384 in -[UINavigationController _startCustomTransition:] () #20 0x000000018d39dca4 in -[UINavigationController _startDeferredTransitionIfNeeded:] () #21 0x000000018d39d3a0 in -[UINavigationController __viewWillLayoutSubviews] () #22 0x000000018d39d304 in -[UILayoutContainerView layoutSubviews] () #23 0x000000018d2b90f8 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] () #24 0x000000018c6e3e30 in CA::Layer::layout_if_needed(CA::Transaction*) () #25 0x000000018c6e39b4 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) () #26 0x000000018c6e9bb4 in CA::Context::commit_transaction(CA::Transaction*, double, double*) () #27 0x000000018c6e31bc in CA::Transaction::commit() () #28 0x000000018d331280 in _UIApplicationFlushCATransaction () #29 0x000000018d330d78 in _UIUpdateSequenceRun () #30 0x000000018d330468 in schedulerStepScheduledMainSection () #31 0x000000018d330524 in runloopSourceCallback () #32 0x000000018b04162c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ () #33 0x000000018b0408a8 in __CFRunLoopDoSource0 () #34 0x000000018b03f058 in __CFRunLoopDoSources0 () #35 0x000000018b03dd88 in __CFRunLoopRun () #36 0x000000018b03d968 in CFRunLoopRunSpecific () #37 0x00000001cf33b4e0 in GSEventRunModal () #38 0x000000018d4b0edc in -[UIApplication _run] () #39 0x000000018d4b0518 in UIApplicationMain () #40 0x0000000104d42ba8 in main at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/main.m:38 #41 0x00000001ae55ed84 in start ()
Posted Last updated
.
Post not yet marked as solved
1 Replies
116 Views
in demo ,load index.html into WKWebView, when i click file button, the camera page present and then dismiss quickly ViewController.h @property (nonatomic, strong) WKWebView *wkWebView; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; WKWebViewConfiguration *configuration = [WKWebViewConfiguration new]; self.wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 300) configuration:configuration]; NSURL *url = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"]; [self.wkWebView loadFileURL:url allowingReadAccessToURL:[[NSBundle mainBundle] bundleURL]]; self.wkWebView.backgroundColor = [UIColor blueColor]; [self.view addSubview:self.wkWebView]; } index. html <html lang="en"> <head> <meta charset="UTF-8"> </head> <body> <div> <label style="font-size: 40px;">open camera</label> <input type="file" accept="image/*" capture="camera" id="file-input" class="file-input"> </div> </body> </html>
Posted
by leozzz.
Last updated
.
Post not yet marked as solved
3 Replies
169 Views
appState=foreground 2024-04-10 10:01:12:439,IPHONE_1ND,10.5.80.6000,3,460000000000000|86dmsu7m2t8cs7w,83D44481-559B-4D5D-BC1F-2E643CF08A16,2088512449022223,exception,-,call_write_crash_log_api,-,-,MonitorPoint_Crash,-,apple-iphone,release,-,-,-,-,-,iPhone16 2,17.4.1,WIFI|--,-,10.5.80.6000,ZbsnB/YU+YsDAEHUUPE53+9a,follow_system_zh-Hans-CN,-,-,-,-,-,-,VoiceOver=0^TimeZone=Asia/Shanghai^AppStatus=background^CIP=(null)^AppSession=195C885D-0152-46E8-8E6D-F6D38D5E0A81^appMode=normal^editionId=300003^lowEnd=T^buildNumber=21E236^simC=2,1,00000000-0000-0000-0000-000000000000 Incident Identifier: 795088EB-76F2-460F-A323-9290DEE9B37F CrashReporter Key: Hardware Model: iPhone16 2 Process: AlipayWallet [972] Path: /private/var/containers/Bundle/Application/EAD57E87-932E-4952-9714-C0B852F3A773/AlipayWallet.app/AlipayWallet Identifier: com.alipay.iphoneclient Version: 10.5.80 (10.5.80.6000) Code Type: ARM-64 Parent Process: [1] Date/Time: 2024-04-10 02:00:47 +0000 OS Version: iPhone OS 17.4.1 (21E236) Report Version: 104 Exception Type: SIGBUS Exception Codes: BUS_ADRERR at 0x16b477fe8 Crashed Thread: 0 Thread 0 Crashed: 0 CoreFoundation 0x0000000190fd5aa8 _generationCountFromListOfSources :104 (in CoreFoundation) 1 CoreFoundation 0x0000000190fd389c -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:] :80 (in CoreFoundation) 2 CoreFoundation 0x0000000190f7a3fc -[CFPrefsSearchListSource alreadylocked_getDictionary:] :492 (in CoreFoundation) 3 CoreFoundation 0x0000000190f79f68 -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] :172 (in CoreFoundation) 4 CoreFoundation 0x0000000190f79e9c -[CFPrefsSource copyValueForKey:] :52 (in CoreFoundation) 5 CoreFoundation 0x0000000190f79e50 ___76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke :32 (in CoreFoundation) 6 CoreFoundation 0x0000000190fcafb4 ___108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke :392 (in CoreFoundation) 7 CoreFoundation 0x0000000190fcadc4 _normalizeQuintuplet :356 (in CoreFoundation) 8 CoreFoundation 0x0000000190fcac38 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] :164 (in CoreFoundation) 9 CoreFoundation 0x0000000190fcab38 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] :156 (in CoreFoundation) 10 CoreFoundation 0x0000000190fca940 __CFPreferencesCopyAppValueWithContainerAndConfiguration :112 (in CoreFoundation) 11 CoreFoundation 0x000000019101a5ec __CFPreferencesGetAppIntegerValueWithContainer :56 (in CoreFoundation) 12 WebKit 0x00000001a651d77c -[WKWebViewConfiguration init] :232 (in WebKit) 13 WebKit 0x00000001a651de28 -[WKWebViewConfiguration copyWithZone:] :48 (in WebKit) 14 WebKit 0x00000001a64e00f8 -[WKWebView configuration] :28 (in WebKit) 15 WebKit 0x00000001a6d93d54 -[WKContentView(WKInteraction) _cascadeInteractionTintColor] :36 (in WebKit) 16 WebKit 0x00000001a6d93f3c -[WKContentView(WKInteraction) _updateTextInputTraitsForInteractionTintColor] :24 (in WebKit) 17 WebKit 0x00000001a6d9d0d0 -[WKContentView(WKInteraction) _updateTextInputTraits:] :1004 (in WebKit) 18 WebKit 0x00000001a6db5de0 -[WKContentView(WKInteraction) extendedTraitsDelegate] :136 (in WebKit) 19 WebKit 0x00000001a6d93a54 -[WKContentView(WKInteraction) insertionPointColor] :48 (in WebKit) 20 UIKitCore 0x000000019338f674 +[UIKBRenderConfig configForAppearance:inputMode:traitEnvironment:] :272 (in UIKitCore) 21 UIKitCore 0x000000019338eb9c -[UIView(UIKB_UIViewExtras) _inheritedRenderConfig] :332 (in UIKitCore) 22 UIKitCore 0x0000000193d32794 -[UICandidateViewController overrideUserInterfaceStyle] :44 (in UIKitCore) 23 UIKitCore 0x00000001939790c4 ___78-[UIViewController _traitCollectionByApplyingLocalOverridesToTraitCollection:]_block_invoke :172 (in UIKitCore) 24 UIKitCore 0x00000001931fbd10 -[UITraitCollection _traitCollectionByModifyingTraitsCopyOnWrite:] :252 (in UIKitCore) 25 UIKitCore 0x0000000193978b08 -[UIViewController _traitCollectionByApplyingLocalOverridesToTraitCollection:] :116 (in UIKitCore) 26 UIKitCore 0x0000000193201c40 -[UIViewController traitCollection] :228 (in UIKitCore) 27 UIKitCore 0x0000000193206a9c __UIGetCurrentFallbackTraitCollection :180 (in UIKitCore) 28 UIKitCore 0x0000000193205568 _UIViewCommonInitWithFrame :548 (in UIKitCore) 29 UIKitCore 0x00000001932052f4 -[UIView initWithFrame:] :132 (in UIKitCore)
Posted
by xiangFly.
Last updated
.
Post not yet marked as solved
0 Replies
74 Views
I am trying to sync up the selected tab bar item once a user presses back and navigates back in the web wrapper iOS app. Here is how the app works: When a user logs in, they are presented with the Home Screen. To navigate, the select a tab item on the tab bar. This tells webkit to redirect to that URL and then that webpage is shown in the app (wrapped). A back button also appears. When a user presses the back button, the webView.goBack() method sends the user back on in the webView.backForwardList. What happens then is that the user is now on the previous page, however the tab bar has not updated. In other words, the user is back on the first tab but the second tab is highlighted. I tried fixing this by telling the tab bar controller what item to select, however this creates a state malfunction because it also tells the webView to navigate to that url again, so in fact this means that the user isn't going back through web history, but actually is going forward while simulating going back. I need to be able to highlight the tab bar items that sync up with the page that we have gone back to without selecting it. Does anyone have an idea for how to manually highlight or select a tab bar item without actually navigating to that tab bar item? Thank you!
Posted Last updated
.
Post not yet marked as solved
2 Replies
132 Views
Hi Everyone, I scanned my iPhone SE 3d generation with the iMazing app developed by Amnesty International, and after the scan it detected 3 Warnings on my iphone. Any of you is able to understand what´s the issue is about? That would be great help! Following the 3 Warnings: Warning - Database Query Error - WebKit Observations - 'AppDomain-com.apple.tips/Library/WebKit/WebsiteData/ResourceLoadStatistics/observations.db' cannot be parsed (no such table: ObservedDomains). Warning - Database Query Error - InteractionC - 'HomeDomain/Library/CoreDuet/People/interactionC.db' cannot be parsed (no such table: ZINTERACTIONS). Warning - Database Query Error - InteractionC Attachment - 'HomeDomain/Library/CoreDuet/People/interactionC.db' cannot be parsed (no such table: ZATTACHMENT).
Posted
by Paolo03.
Last updated
.
Post not yet marked as solved
1 Replies
89 Views
I modified an InputMethodKit example (fairly recent one from github, compiled fine and worked as expected on my machine as it was) to create a window with a WKWebView and the window doesn't load. I know that loadView is getting called, but the window never appears after calling showWindow on the window controller and there is a mysterious error in the console: bootstrap_check_in(): (os/kern) unknown error code (44c) From googling this it seems App Sandbox related, but I think I have everything set up correctly (App Sandbox on with outgoing connections allowed) Totally stumped, any help or ideas would be appreciated Here's the relevant code: View controller import Foundation import WebKit import AppKit class InputWindowViewController: NSViewController, WKUIDelegate { var webView: WKWebView! override func loadView() { NSLog("LoadView") webView = WKWebView() self.view = webView webView.uiDelegate = self webView.needsDisplay = true } override func viewDidLoad() { super.viewDidLoad() webView.load(URLRequest(url: URL(string:"https://www.apple.com")!)) } } Window controller import AppKit import Foundation import WebKit class InputWindowController: NSWindowController { var controller: InputWindowViewController? override init(window: NSWindow?) { controller = nil super.init(window: window) } override func loadWindow() { self.window = NSWindow(contentViewController: controller!) } required init?(coder: NSCoder) { controller = nil super.init(coder: coder) } } AppDelegate import Cocoa import InputMethodKit import WebKit // Necessary to launch this app class NSManualApplication: NSApplication { private let appDelegate = AppDelegate() override init() { super.init() self.delegate = appDelegate } required init?(coder: NSCoder) { // No need for implementation fatalError("init(coder:) has not been implemented") } } @main class AppDelegate: NSResponder, NSApplicationDelegate { var server = IMKServer() var candidates = IMKCandidates() var inputWindowController = InputWindowController() func applicationDidFinishLaunching(_ notification: Notification) { // Insert code here to initialize your application server = IMKServer(name: Bundle.main.infoDictionary?["InputMethodConnectionName"] as? String, bundleIdentifier: Bundle.main.bundleIdentifier) inputWindowController = InputWindowController() inputWindowController.controller = InputWindowViewController() inputWindowController.loadWindow() inputWindowController.showWindow(self) candidates = IMKCandidates(server: server, panelType: kIMKSingleRowSteppingCandidatePanel, styleType: kIMKMain) NSLog("tried connection") } func applicationWillTerminate(_ notification: Notification) { // Insert code here to tear down your application } } This code is probably awful in a lot of other ways I don't realize, but I wanted to get a webview window up before I put a bunch of time into this thing XCode 13.4 MacoOS 12.7.4
Posted Last updated
.
Post not yet marked as solved
0 Replies
113 Views
I am currently working on an iOS application where I want to implement the safari tabs and when I have to minimize that one to check how many numbers of tabs are opened. How can I do this?
Posted
by ckdash.
Last updated
.
Post not yet marked as solved
3 Replies
329 Views
Hi all, An app that until yesterday would take 1 second to render a list in the WKWebView is now taking over 3 minutes to load. No changes have been made to the app or the content that it is showing. I have tested on a device running 17.3, and performance has been acceptable, and then updated to the latest security fix (17.4.1) and now 3 minutes. Having read the release notes https://support.apple.com/en-us/HT214097 I cant see what would have affected either the processing of javascript or the rendering of content within the web view. My team is currently running all our apps that use a hosted WKWebView within it to ensure that they aren't affected, but this one app is now unusable and safety concern for the users (Airline Safety). Has anyone else experienced this or has a workaround - Sorry there are no logs (I have been scanning the device logs and nothing new is appearing - almost as if the operation is just dead locked).
Posted
by RobPeppin.
Last updated
.
Post not yet marked as solved
0 Replies
149 Views
Hello, Currently, my app only uses web view to load HTML data and external safari web view by link click. I have seen the following developer's details. So if HTML data load on web view needs data collection enabled, then which Types of data need to be added to data collection? Also. if we disable all types of Data collection from privacy. Is apple will allow you to submit the app? or Reject it? Any help will be appreciated. Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
179 Views
Hello Apple We have read your guide on https://developer.apple.com/documentation/bundleresources/privacy_manifest_files#4284009 and it is unclear how the NSPrivacyTrackingDomains affects WebView functionality of the app. We have WebView based functionality we use for signup/ login of customers in the app and that can potentially track users. It is stated that If the user has not granted tracking permission through the App Tracking Transparency framework, network requests to these domains fail and your app receives an error. However based on our testing the domains listed in NSPrivacyTrackingDomains have no effect on network requests happening in the WebView if the user declines tracking via the App Tracking Transparency prompt. (e.g pages are loaded, network requests to listed tracking domains are happening) Can you confirm it is the case on what should de done about it? Right now we have a custom implementation on our side that passes the result of the App Tracking Transparency prompt to the WebView instructing it weather it can send requests to tracking domains or not.
Posted
by VASG.
Last updated
.
Post not yet marked as solved
0 Replies
135 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
110 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
186 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
202 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
129 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
180 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
.