Questions tagged [wkwebviewconfiguration]
173 questions
2
votes
2 answers
mediaTypesRequiringUserActionForPlayback not working Swift
I am developing an app that access to a web page with WKWebView in Swift. This web starts playing a sound automatically. I want not allow to play the sound automatically. I would like to use something like mediaPlayBackRequieresUserAction = true but…

Daniel Fernandez
- 241
- 3
- 6
- 14
2
votes
1 answer
WKWebView only showing desktop site
I just migrated from UIWebView and my new WKWebView will only show the desktop version of the site I'm loading. My UIWebView showed the responsive site appropriately.
I have tried forcing a mobile User-Agent and confirmed that it is coming in on to…

timbroder
- 858
- 1
- 13
- 25
2
votes
1 answer
Can using multiple WKWebViews be as fast as reusing the same WebView
My app is much faster when I reuse the same WKWebView for new navigations (but I would love to be able to create new WKWebViews for each navigation so I can maintain a ViewController stack).
I've noticed however, that the pages load slower when I…

Michael Cueno
- 434
- 4
- 14
2
votes
0 answers
Stop wkWebView sound when dismissing containing viewController
In my view controller i have a WKWebView which play video with sound
When i dismiss the the view controller using:
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
The video sounf still play.
How can i stop it?

Michael A
- 5,770
- 16
- 75
- 127
2
votes
2 answers
WKWebView: calling javascript after page is loaded
I am doing the following:
load a WKWebView, lets call this view A
ask the user to enter some details
ask the user to click a button
intercept the click on the WKWebView and PUSH a new view on the application, lets call this view B
allow the user…

mm24
- 9,280
- 12
- 75
- 170
1
vote
1 answer
WKWebView not Showing Print Page
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate{
@IBOutlet weak var webVw: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Load a URL
if let url =…

Ben Rockey
- 920
- 6
- 23
1
vote
0 answers
WebKit Error: This method should not be called on the main thread as it may lead to UI unresponsiveness
I'm currently facing an issue with threads in my iOS app. After testing, it seems that the problem is related to the WebKit integration.
Here is the relevant portion of the showTrailerViewController class:
class showTrailerViewController:…

malamudCode
- 11
- 2
1
vote
0 answers
WKUserContentController methods not called when after url change
I have a WkWebView where I load my webpage. The webpage is a questionnaire so there are several steps with questions and on final page I get the result. I want to detect when user is at the final page. The web page uses postMessage to send data. To…

pankaj
- 7,878
- 16
- 69
- 115
1
vote
0 answers
Use AutoFill with WKWebView on Microsoft login URL
I access the Microsoft login URL https://myapplications.microsoft.com in my app. I noticed, that AutoFill is not provided by WKWebView when it comes to pages where JavaScript is used and credentials are spread across 2 pages. However from Safari,…

geohei
- 696
- 4
- 15
1
vote
0 answers
WKWebView requires new login
Code below is very simple. I use WKWebView to login to my Microsoft account.
class MSAuthenticationViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {
@IBOutlet var webView: WKWebView!
@IBOutlet var DoneBonnon:…

geohei
- 696
- 4
- 15
1
vote
0 answers
WKWebView: How to disable data detection and automatic link detection on macOS?
The key here is macOS, not iOS.
Data detection can easily be disabled on iOS via WKWebViewConfiguration.dataDetectorTypes, but this property is not available on macOS.
Background:
I have a WKWebView embedded in a macOS app that shows a…

Mark
- 6,647
- 1
- 45
- 88
1
vote
0 answers
ios simulator webview throws "Timeout has occurred"
I'm doing a simple mobile application which embeds a WkWebView to display my website using Ionic 6 + Angular.
I have tested my website with Chrome and Safari on Macbook, everything was fine until I opened it on my WKWebView control.
At first, my…

Redplane
- 2,971
- 4
- 30
- 59
1
vote
1 answer
WkwebView Crash On request audio & microphone pop up ios 15.4
I get an unknown error with WKWebView on my Iphone.When try to Change the navigation link inside the view the destination link request camera and microphone permission. when try to view the alert between WKWebView and the device its crashed .
Cannot…

cat
- 25
- 1
- 2
- 10
1
vote
0 answers
Changing User Agent in WKWebView on iPad
I noticed something strange with WKWebView user agents.
If I try setting it as
webViewConfiguration.defaultWebpagePreferences.preferredContentMode = .mobile
webViewConfiguration.applicationNameForUserAgent = "MYIOSAPP/\(appVersion)"
I get…

plato522
- 133
- 6
1
vote
0 answers
Back Button not working quickly, Take 4-5 Second Webview to back, How to get Progress SwiftUI
I'm writing a Webapp in swiftUI with xcode13.1 I've a question "How can I add a progress bar that shows me the loading of page when user click on back button?
import SwiftUI
import WebKit
struct WebViewForCommunityTab : UIViewRepresentable {
let…

Sham Dhiman
- 1,348
- 1
- 21
- 59