Questions tagged [wkwebviewconfiguration]

155 questions
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
  • 10,568
  • 2
  • 44
  • 55
5
votes
0 answers

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
  • 537
  • 1
  • 8
  • 21
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,435
  • 3
  • 24
  • 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
  • 7,457
  • 2
  • 35
  • 53
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,444
  • 15
  • 62
  • 115
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…
pupeno
  • 256,034
  • 114
  • 324
  • 541
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
  • 3,835
  • 15
  • 41
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
  • 2
4
votes
1 answer

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
1 answer

How do i copy everything from one WKWebView to a new WKWebView

I'm trying to copy all loaded data from one WKWebView to a new WKWebView so all content would be loaded when new webView is presented. Any suggestion how to do this or what would be the best approach to this?
PashaN
  • 292
  • 2
  • 16
4
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,277
  • 22
  • 34
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…
4
votes
0 answers

wkwebview requiresUserActionForMediaPlayback not working

i have a wkwebview that goes into youtube and I would like to click on a video without it automatically throwing me into the video player. I tried stopping this in 3 different ways using the config.requiresUserActionForMediaPlayback = true in the…
stanley
  • 1,021
  • 10
  • 25
3
votes
3 answers

Load html text in WKWebView

I use this code to load my html file with text in WKWebView: do { guard let filePath = Bundle.main.path(forResource: "\(readBookNumber)", ofType: "html") else { print ("File reading error") return } var…
User
  • 51
  • 8
3
votes
1 answer

Why window.close is not working for multiple windows

I have used Handling new window inside webview. I have used solution 2 from the mentioned link, Which was adding the new window to the subview. This solution provided in this link works pretty well. But the problem I faced here is when I open…
1
2
3
10 11