Answer the question
In order to leave comments, you need to log in
How to add title to requests inside WKWebView?
There is a WKWebView and some HTML text, inside of which there are img tags with links to external images. However, the problem is that access to these images requires an Authorization header with an authorization token. How to intercept these requests and add your own header?
@IBOutlet weak var wkWebView: WKWebView!
let html = "..." // HTML с изображениями и т.д.
wkWebView.loadHTMLString("<font face='GothamRounded-Bold' size='17'>\(html)</font>", baseURL: nil)
Answer the question
In order to leave comments, you need to log in
learn to stick a list of folders to the path of each subdomain and check if such a folder exists on such a path
Unfortunately, this cannot be done. I had to make changes to the back so that the token was inserted into the parameters of all hotlinks inside the HTML.
There will not be any difference between loading web view from loadRequest vs loadHTMLString method, shouldStartLoadWithRequest method will be called in both cases. You can override your headers there and add a header as per your requirements.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question