Questions tagged [wkwebviewconfiguration]

155 questions
3
votes
2 answers

"@TRUE" in Objective-C

Recently I saw this code: WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; [configuration.preferences setValue:@TRUE forKey:@"xxxx"]; What does @TRUE stands for? I'm seeing this construct for the first time. I know…
Richard Topchii
  • 4,569
  • 3
  • 27
  • 70
3
votes
2 answers

Return result from called function in iOS to calling function in WkWebView in JavaScript

We called a function in iOS from javascript i.e var data = webkit.messageHandlers.callbackHandler.postMessage("Hello from JavaScript"); I want to assign returned value in data variable from called method in iOS. iOS Code : func…
3
votes
2 answers

programmatically change WKWebView content size

I added a WKWebView subview into a PhoneGap / Cordova 4.0+ app (via cordova-plugin-wkwebview-engine) and used programmatic AutoLayout constraints to get the WKWebView to size the same as the MainViewController's view. When I view the bounds of the…
3
votes
1 answer

WKWebview javascript works on simulator but doesn't work on device if the view isn't on the screen

I'm using a WKWebview to run javascript scripts. I am not using JSContext et.al since I need the javascript context to be able to perform XHTTP requests which aren't possible with JSContext alone. This view is not added to the view hierarchy and I…
Avner Barr
  • 13,049
  • 14
  • 82
  • 152
3
votes
1 answer

WKWebView: How to local storage enable in iOS8

I'm trying to local storage enable. But in iOS8, I can't find how to do it. let configuration = WKWebViewConfiguration() if #available(iOS 9.0, *) { configuration.websiteDataStore = WKWebsiteDataStore.defaultDataStore() } else { //?? }
ysknsn
  • 77
  • 1
  • 9
3
votes
1 answer

Use shared WKWebViewCookies for a request

I have a few different WKWebViews inside my project they are all sharing cookies over a single WKProcessPool. Now I want to make a request on a REST API and need to send exactly that cookies from that WKWebViews to that API. Is there a way to get…
Joschka Schulz
  • 674
  • 1
  • 8
  • 17
3
votes
1 answer

Can multiple instances of WKWebView in the same app have a separate cookie store?

I have a couple of WKWebViews in my app. I don't want the cookies/auth to be shared between them. I tried using separate instances of WKProcessPool and WKWebViewConfiguration to initialize the other webview. It doesn't work. What am I doing wrong?
esh
  • 2,742
  • 5
  • 20
  • 37
3
votes
1 answer

Hide specific DIV on webpage in WKWebview

I am building an iOS app and using WKWebview to link to a external website (we don't control this website) in WKWebview. It all works fine but there are certain parts of the webpage, I do not want to show in the iOS app. After doing some research…
vinny
  • 487
  • 4
  • 7
  • 16
3
votes
1 answer

WKWebView shows google search result as raw html

I am trying to add a web browser in an app that I'm working on using iOS WKWebView. But the WKWebView loads the raw html for google search result. https://i.imgur.com/LJemP75.jpg Here's a part of the code I'm using: let configuration =…
3
votes
2 answers

How to autoscale the contents of a WKWebView?

To autoscale a webpage inside a good old WebView in Swift, all I had to do was: var w:UIWebView w.scalesPageToFit=true I cannot find an equivalent method for a WKWebView, and webpages appear too big in my app. How can I autoscale the contents of a…
Josh
  • 5,781
  • 1
  • 39
  • 67
2
votes
1 answer

defaultWebpagePreferences error while building ios build for ionic 5 code

I am trying to build an ios build for ionic 5 app, i am getting this error in my app while building the app. I looked out for solutions on internet but nothing seems to…
2
votes
1 answer

WKWebview Delegate methods in Objective-C

updating my code from UIWebView to WKWebview but having this error on my delegate methods Nullability specifier 'nonnull' conflicts with existing specifier 'null_unspecified' here is my code an showing this error on navigation -…
Vix Hunk
  • 303
  • 3
  • 16
2
votes
0 answers

How do I implement Calendar Events from WKWebView into my iPhone?

I have a UIViewController in which a WKWebView is implemented. My problem is: I would like, because on the Websites URL is a button with a calendar event, import this into my app. In other words, if you push the pushed button a query appears in…
Shinox
  • 97
  • 9
2
votes
2 answers

How to fetch cookies from WKWebView for iOS 10 and below?

I have tried following approaches to fetch the cookies from WKWebView in iOS 10 and below and not able to get the cookies: 1: Fetching cookies from HTTPCookieStorage. 2: Fetching the cookies form WKNavigationResponse model once the loading is…
Vinay Kiran
  • 319
  • 3
  • 14
2
votes
1 answer

Swift 4 WKWebView cookies fetch and delete synchronisation issue

I am making an app which makes decision of user login / logged out and other activities based on WkWebView cookies. Most of the time , it works fine. Sometimes , it failed to fetch cookies when login URL succeeded. And fails to delete the cookies…
Jamshed Alam
  • 10,887
  • 5
  • 22
  • 42
1 2
3
10 11