Questions tagged [wkwebviewconfiguration]

173 questions
6
votes
1 answer

mediaPlaybackRequiresUserAction deprecated and iOS 9

WKWebViewConfiguration: mediaPlaybackRequiresUserAction has been deprecated since iOS 9 In WKWebViewConfiguration: @available(iOS, introduced: 8.0, deprecated: 9.0) open var mediaPlaybackRequiresUserAction: Bool And specified by…
Niko
  • 3,412
  • 26
  • 35
5
votes
3 answers

Swift 4/5 setting adding proxy to WKWebview

I have looking for a way to set a proxy to WKWebview request with no luck. By another hand I have been able to set proxy to http request func createURLSessionConfiguration(_ host:String,_ port:String) -> URLSessionConfiguration { let config =…
5
votes
0 answers

How to send cookies in WKWebView httpcookiestore along with request

In an iOS 11 app, I've set cookies in my WKWebView and verified that they're set by viewing them in safari inspector. However, I don't believe they're being passed along in my request. Is there something else I need to do besides setting them in…
Frankie
  • 11,508
  • 5
  • 53
  • 60
5
votes
4 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…
5
votes
1 answer

How to return data from WKWebView to JavaScript

I am developing a hybrid Android and iOS app using WebViews. However, I am struggling to return data from iOS app back to my Javascript. Below is how I setup the WebView to receive data from my JavaScript functions. private lazy var…
tinOfBeans
  • 707
  • 1
  • 9
  • 22
5
votes
0 answers

Cordova Ionic 2 WKWebView hide scroll bars

I'm trying to remove all scrollbars from my ionic 2 app using the WKWebView I can hide them with css using the standard webview, but when using the WKWebView it does not work. I have tried editing the CDVWKWebviewEngine.m file with the following but…
rorypicko
  • 4,194
  • 3
  • 26
  • 43
5
votes
1 answer

WKWebView completionHandler called before dismissal

I am using WKUIDelegate this function to handle javascript alert -(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler { …
hariszaman
  • 8,202
  • 2
  • 40
  • 59
5
votes
2 answers

JS calling a function in Swift

I know how to send message from JS to native IOS swift app: func userContentController(userContentController: WKUserContentController!, didReceiveScriptMessage message: WKScriptMessage!) { println("JavaScript is sending a message…
Michael A
  • 5,770
  • 16
  • 75
  • 127
5
votes
0 answers

Making WKWebView not share cookies with Safari in OS X

How do I make WKWebView not share cookies with Safari in OSX? I have a very simple app that I made as an experiment that displays a WKWebView and as far as I can see, it's picking up cookies from Safari, because in my custom app, I'm logged in in…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
4
votes
0 answers

How to keep user logged in on WKWebview in SwiftUI

I have a website that asks for login in initial page and I would like to have users stay logged in so they don't have to input the login info every time they turn on the app. Here is my current code for calling WKWebkit. It does everything I need it…
ji sung Choi
  • 123
  • 1
  • 7
4
votes
1 answer

WKWebview : Ignoring request to load this main resource because it is outside the sandbox

In our app we are using readium library SDK to load epub file. WKWebview could not be load epub file because epub has been downloaded from server and saved in document path. WKwebview has issue with accessing that file. Note :- Same is working in…
Kanagaraj
  • 51
  • 3
4
votes
1 answer

"loadHTMLString" height width issue with WKWebView

I am trying to load HTML content to WKWebView, It does not load properly the same as screen height/width, same code is working fine with UIWebView, See the following code webView.loadHTMLString(htmlString!, baseURL: nil) HTML string content
AtulParmar
  • 4,358
  • 1
  • 24
  • 45
4
votes
1 answer

How to stop WKWebView from creating too many processes?

I have a MacOS app that creates many NSViews of differing types, some of which contain WKWebViews. The Number of WKWebViews can become fairly large (dozens or more). The problem is that each of these WKWebViews creates several processes, as can be…
ArtSwanson
  • 51
  • 3
4
votes
2 answers

Allow document upload in input file on WKWebView

I have an html input type="file" upload form on a page loaded through wkwebview, and I'm trying to allow the ability to upload common document files (pdf, docx, etc). Currently I have the ability to take pictures and browse for images, but…
Justin M
  • 103
  • 1
  • 8
4
votes
2 answers

WKWebView pick cookies from NSHTTPCookieStorage

Does anyone know how to set a WKWebView to pick cookies from NSHTTPCookieStorage ? I tried injecting the cookie through WKUserScript, but it doesn't work since my page has several redirections, and every page in that redirection uses a cookie. Any…
1
2
3
11 12