wkwebview

Is it possible to turn off location permission in WKWebView?

て烟熏妆下的殇ゞ 提交于 2021-01-27 14:33:44
问题 I am wondering if it is possible to stop WKWebView from showing the location permission prompt? ( "website.com" Would Like To Use Your Current Location ) I believe it is showing because the website contains a google map. I am not interested in preloading a location in its place like is shown in other SO questions. I simply don't want to use location in the WKWebView. Is there a way to stop the location permission prompt from appearing? I have tried injecting the following javascript but it

Cannot read property 'messageHandlers' of undefined

拥有回忆 提交于 2021-01-27 05:57:05
问题 I want to pass JavaScript variable to Swift. I get an error in JavaScript & search for that but I didn't get any result. The error is: TypeError: Cannot read property 'messageHandlers' of undefined Any one can help? My code in Xcode: import UIKit import WebKit class ViewController: UIViewController,WKScriptMessageHandler,WKNavigationDelegate { var webView = WKWebView() override func viewDidLoad() { super.viewDidLoad() webView.frame = view.bounds webView.navigationDelegate = self let url = URL

Cannot read property 'messageHandlers' of undefined

不打扰是莪最后的温柔 提交于 2021-01-27 05:54:42
问题 I want to pass JavaScript variable to Swift. I get an error in JavaScript & search for that but I didn't get any result. The error is: TypeError: Cannot read property 'messageHandlers' of undefined Any one can help? My code in Xcode: import UIKit import WebKit class ViewController: UIViewController,WKScriptMessageHandler,WKNavigationDelegate { var webView = WKWebView() override func viewDidLoad() { super.viewDidLoad() webView.frame = view.bounds webView.navigationDelegate = self let url = URL

Disabling cookies in WKWebView

萝らか妹 提交于 2021-01-24 07:27:01
问题 Is it possible at all to disable cookies and local storage in a WKWebView? Let's say that this is my setup, and I want to add something that disables them: import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { var webView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad()

Disabling cookies in WKWebView

南笙酒味 提交于 2021-01-24 07:26:36
问题 Is it possible at all to disable cookies and local storage in a WKWebView? Let's say that this is my setup, and I want to add something that disables them: import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { var webView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad()

Disabling cookies in WKWebView

本秂侑毒 提交于 2021-01-24 07:25:55
问题 Is it possible at all to disable cookies and local storage in a WKWebView? Let's say that this is my setup, and I want to add something that disables them: import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { var webView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.uiDelegate = self view = webView } override func viewDidLoad() { super.viewDidLoad()

Does WKWebView uses cookies from Safari?

坚强是说给别人听的谎言 提交于 2021-01-24 06:59:12
问题 According to Apple documentation: ... cookies are shared among all applications and are kept in sync across process boundaries. But there is this iOS Note : Cookies are not shared among applications in iOS. So basically I can not use cookies from Safari inside my app? 回答1: iOS security sandbox disables cookie sharing amongst apps using WKWebView as you've discovered with the iOS note and there's no way around this. You can share cookies between multiple WKWebView 's inside your app by

Shared cookies with WKProcessPool for WKWebView in Swift

一曲冷凌霜 提交于 2021-01-01 18:33:09
问题 Can anyone please tell me how to create a WKProcessPool in Swift? I'm not familiar with Objective-C. I have to create a WKProcessPool in order to have shared cookies with all WKWebViews. I want to keep cookies even when showing another viewcontroller with same class. I tried the following but it's not working. import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var webView = WKWebView() override func viewDidLoad() { super.viewDidLoad() let processPool =

Shared cookies with WKProcessPool for WKWebView in Swift

ぃ、小莉子 提交于 2021-01-01 17:52:55
问题 Can anyone please tell me how to create a WKProcessPool in Swift? I'm not familiar with Objective-C. I have to create a WKProcessPool in order to have shared cookies with all WKWebViews. I want to keep cookies even when showing another viewcontroller with same class. I tried the following but it's not working. import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var webView = WKWebView() override func viewDidLoad() { super.viewDidLoad() let processPool =

cordova ios WKWebView upgrade - errors when showing some images

喜欢而已 提交于 2020-12-15 07:09:45
问题 I'm working on an app with Ionic 1 and AngularJS 1.5 I was told that I need to upgrade my ios to use WKWebView instead of UIWebView: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/?utm_campaign=enterprise&utm_source=hs_email&utm_medium=email&utm_content=85128961&_hsenc=p2ANqtz--vsf3kcg7MssMWwjv2_GpHmVbzN23_5fXDfKT0E6OileYraLWs9btGPqWUcq5mzTKCtKwXGqO35V3SnInjypj4uqSBRg&_hsmi=85128961 Here is my setup: cordova-android 8.1.0 cordova-ios 5.1.0 cordova-plugin