In Safari you can increase and decrease the font size. How can I achieve the same effect with WKWebView?
To use custom fonts in WKWebView, we need to do three things. Add custom fonts to your app. Load custom fonts to CSS with @font-face. Introduce app bundle to WKWebView.
In many applications, you can increase the text size at any time by pressing Ctrl + + . To reduce the text size, press Ctrl + - . Large Text will scale the text by 1.2 times. You can use Tweaks to make text size bigger or smaller.
The codes suggested by Inna used to work but stopped working from iOS10.3. I did some research and found that we need to make a slight change to it, just changing "%%" to a single "%".
So JS code should be:
let js = "document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='\(fontSize)%'"
I got this info from Apple Developer forum. https://forums.developer.apple.com/thread/51079
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With