wkwebview

Open iframe video in fullscreen programmatically

醉酒当歌 提交于 2021-01-29 14:33:22
问题 I open youtube video using iframe in webview. It shows default control buttons for video including fullscreen button. How can I call function of fullscreen button by myself? For example, I want go to fullscreen on landscape, but videos open in fullscreen only by tap on fullscreen button or while first loading. I need go to fullscreen while playing video. 回答1: Hope you are using YTPlayer for YouTube Videos. If not you can find the player here - GithubLink For YTPlayer, there's a parameter

How to configure WkWebView in xamarin.forms iOS?

被刻印的时光 ゝ 提交于 2021-01-29 11:35:24
问题 Recently, I can't publish my new app to App Store due to the following error: ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview). Question 1, what is UIWebView and WkWebView? I can't even find a single word "UIWebView" in my project, how Apple knows I'm using it? The pages that I used are all xamarin based and Content Page

How to access goBack and goForward via UIViewRepresentable

泪湿孤枕 提交于 2021-01-29 11:31:45
问题 I have added a WKwebview in SwiftUI via UIVewRepresentable. I am having difficulties getting some buttons to make the web view go back and go forward. Below is the two classes I have made but I am not even getting print to work ( maybe a bug? ). import SwiftUI import WebKit struct Webview : UIViewRepresentable { let request: URLRequest func makeUIView(context: Context) -> WKWebView { return WKWebView() } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } func

Why my WKWebview inside my UIScrollView is not displayed?

不问归期 提交于 2021-01-29 05:32:02
问题 I need to add a WKWebview to load web content, inside the content view of UIScrollView. I'm using the Apple code to load a web page, my outlet viewForWebview is linked correctly, and didFinish is called. class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate { var webView: WKWebView! @IBOutlet var viewForWebview: UIView! override func loadView() { super.loadView() let myConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration:

Read local storage data using WKWebView

跟風遠走 提交于 2021-01-28 19:21:47
问题 I need to read value stored in the local storage of WKWbview. I tried using the below code but getting nil. I am able to write values in local storage but facing difficulty in reading values from it. let script = "localStorage.getItem('token')" wkWebView.evaluateJavaScript(script) { (token, error) in print("token = \(token)") } WKWebView init code: // 1 let accessToken = UserDefaults.standard.value(forKey: "token") as? String // 2 let refreshToken = UserDefaults.standard.value(forKey:

Read local storage data using WKWebView

血红的双手。 提交于 2021-01-28 19:06:26
问题 I need to read value stored in the local storage of WKWbview. I tried using the below code but getting nil. I am able to write values in local storage but facing difficulty in reading values from it. let script = "localStorage.getItem('token')" wkWebView.evaluateJavaScript(script) { (token, error) in print("token = \(token)") } WKWebView init code: // 1 let accessToken = UserDefaults.standard.value(forKey: "token") as? String // 2 let refreshToken = UserDefaults.standard.value(forKey:

Cocoa: Youtube video does not support full screen in WKWebview

泪湿孤枕 提交于 2021-01-28 08:01:58
问题 I’m making a web browser using Xcode, I played with the browser then relized the it dosn’t play full screen youtube video’s and embeded videos. I have tried this code... let webViewConfiguration = WKWebViewConfiguration() webViewConfiguration.allowsInlineMediaPlayback = false WKWebView(frame: .zero, configuration: webViewConfiguration) But it says Wkwebview has no member of allowsInlineMediaPlayback. This is an image of what youtube shows Here is my code for more detail… import Cocoa import

Swift WKWebView continuous spell checking

牧云@^-^@ 提交于 2021-01-28 07:21:46
问题 We have an embedded HTML form type editor in a macOS app that needs to be filled by the user. We are using WKWebView with Swift and it's all working fine but we are not able to get the spell check working in WKWebView. I mean it does work and corrects some words but doesn't show red dotted underline on misspelled words like WebView. WebView shows dotted redline where WKWebView does not. Found that WebView has property as isContinuousSpellCheckingEnabled but no such property is available in

Swift 3 - WKWebView Load Local HTML not loading resource files

此生再无相见时 提交于 2021-01-28 07:16:06
问题 I was download my website from online to store in xcode project with a sub-folder and want to run in WKWebView locally. I found the webview loaded webpage miss all CSS/JS/Images resources. I search around the internet and still not working. Is webpage inside relative url incorrect or my code to get the Main Bundle location problem? Anyone can help. Thanks. Xcode Project Structure HTML Page Contents Sample I wrote this code to load WKWebView let htmlFile = Bundle.main.path(forResource:

WKWebView not detecting URL is different

余生颓废 提交于 2021-01-28 06:34:21
问题 I have 3 URL's I open within my app using a WKWebView . These URL's are used to trigger an SSO into another product, using a cookie set by my app on login. They look as follows shop https://identity.domain.io/auth/some/params/protocol/saml/clients/sso?RelayState=shop_page profile https://identity.domain.io/auth/some/params/protocol/saml/clients/sso?RelayState=profile_page home https://identity.domain.io/auth/some/params/protocol/saml/clients/sso When I open any tabs, the view loads correctly.