Questions tagged [wkwebview]

A WKWebView object displays interactive web content. It is provided by Apple's WebKit which is available for macOS, iOS and tvOS as well.

A WKWebView object displays interactive web content. It is provided by Apple's Open Source Project WebKit and is available for macOS, iOS and tvOS as well.

Links:

3852 questions
2
votes
1 answer

How to prevent WKWebView from being emptied after app sent to background

I am developing an app that uses WKWebView to render web content. Everything works fine so far except one thing: if I load a page on my WKWebView then send the app to the background for a while (I'd say around ten minutes) and reopen the app, my…
Randy
  • 4,335
  • 3
  • 30
  • 64
2
votes
2 answers

Cannot click on HTML input button with Javascript and WebView (Possibly an iframe issue, not sure)

I am working on an iOS app that performs some actions in a webview using injected javascript. I am trying to press a submit button on a router's web-interface (So I can't give you a url). I've tried many other proposed solutions online but nothing…
metacore
  • 91
  • 1
  • 9
2
votes
1 answer

WKWebView does not load NSURLs created with fileURLWithPath:relativeToURL:

I noticed that WKWebView does not load (via loadFileURL:allowingReadAccessToURL:) an NSURL created with fileURLWithPath:relativeToURL:. I created a github repo showing this behavior: https://github.com/davidkraus/WKWebViewNSURL
2
votes
0 answers

wkWebView troubles in iOS 9: missing long tap, cannot select text properly

I am experiencing a couple of strange wkWebView behaviours on iOS 9, and I believe that these two issues are somehow connected... 1) Text selection is not working in wkWebView. As a test environment, I am loading an HTML file into wkWebView. After…
Федор Усаков
  • 1,205
  • 2
  • 13
  • 29
2
votes
1 answer

Detect when WKWebview cannot handle a request

I have the following code NSURL *nsurl = [NSURL urlWithString:@"http://url.that.does.not.exist.com"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:nsurl]; WKWebViewConfiguration *config = [WKWebViewConfiguration new]; WKWebView…
nacho4d
  • 43,720
  • 45
  • 157
  • 240
2
votes
2 answers

How do I intercept downloads from a WKWebView?

I am making a Cocoa app that involves users selecting pictures from online for use within the app. I am also looking to collect contextual metadata from those downloads, such as the host the image came from, the website the user was visiting, the…
William Rosenbloom
  • 2,506
  • 1
  • 14
  • 37
2
votes
0 answers

How to share cookies set in response in WKWebview with further dataTaskWithRequests

I'm trying to set cookies on a dataTask on NSURLSession.sharedSession(), obtained from a webpage in a WKWebView instance. Somehow when reading the cookies from NSHTTPCookieStorage.sharedHTTPCookieStorage() after visiting the webpage with cookies set…
tapmonkey
  • 141
  • 2
  • 9
2
votes
2 answers

Cleaner way to hook into the window.onload of a web page?

I'm building a small iOS App in Swift and I use the WKWebView. What I am trying to achieve is to be notified when a web page has rendered completely. It is a known issue with WKWebView that none of its loading notifications work. However, this…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
2
votes
1 answer

WKWebView: Add a button that loads up URL

On my WKWebView app, I want to add a button that user can click to go to the home URL. I have the home URL stored in url: let url = NSURL(string: "http://stackoverflow.com")! Then I create the button like this: let htmlURL = UIBarButtonItem(title:…
Henrik Petterson
  • 6,862
  • 20
  • 71
  • 155
2
votes
1 answer

How to open a url when clicking on Push Notifications in swift 2?

I am actually using Amazon Web Services SNS to send push notifications in my IOS application. When clicking on the push notification while the application is running in the background the url(sent by the push notification) is open correctly in the…
S.D
  • 93
  • 1
  • 1
  • 11
2
votes
1 answer

iOS WKWebView File upload failure on iPhone

In our app we use WKWebView to display web contents, but the file upload works incorrectly. On iPhone we could browse from photo library (or take picture) but after the file has been selected, a thumbnail image shows up on the right side of the file…
NYS
  • 231
  • 1
  • 3
  • 10
2
votes
0 answers

After login WKWebView Session Logout in iOS

In my app, I want to do login using WKWebView and then all further request to server is done. I'm able to perform successful login using WKWebView. On it's success I get session information. I had implemented it previously using UIWebView and it was…
2
votes
1 answer

Xamarin iOS WKWebView showing JavaScript Alert

I would like to show the JavaScript Alert in my WKWebView. I have implemented the IWKUIDelegate and its methods RunJavaScriptAlertPanel, RunJavaScriptConfirmPanel. These gets called for a JavaScript Alert. I would like to know how to handle the…
User382
  • 864
  • 19
  • 42
2
votes
1 answer

Xamarin iOS clear cache from WKWebView

I am doing following to clear the cache from the WkWebView. I would like to know how do I confirm that the cache is cleared var request = new NSUrlRequest (webURL, NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 0); …
User382
  • 864
  • 19
  • 42
2
votes
1 answer

Re-parenting a WKWebView after displaying it on one VC

I'm using WKWebView as the central document object in an App, not just as a passive portal to the Web. The same document shows up in a few different places in the App, so ideally the view will render as efficiently as a native UIKit based UIView.…
BaseZen
  • 8,650
  • 3
  • 35
  • 47