'Autofill,save password,spellcheck,Application cache in WkWebview
I am looking for a way to do AutoFill,SavePassword and Spellcheck in WkWebView
AFAIK
SpellCheck(spellcheck="true"),Autocomplete('autocomplete','off') can be done by specifying HTML Attributes
SavePassword and Autofill can be worked around using stringByEvaluatingJavaScriptFromString and NSUserDefaults
I have an webapp which is going to be loaded in WkWebView and I'd like to facilitate SavePassword,AutoFill and Spellcheck using WkWebView itself.
Does WkWebView provide any interface to directly deal with these ?
Any suggestions are appreciated !
Solution 1:[1]
AFAIK, Apple doesn't allow us to use Autofill in WKWebview because the app may steal your information.
Solution 2:[2]
Enable Password AutoFill
Password AutoFill uses heuristics to determine when the user logs in or creates new passwords, and automatically provides the password QuickType bar. These heuristics give users some Password AutoFill support in most apps, even if those apps haven’t been updated to support AutoFill. However, to provide the best user experience and ensure your app fully supports Password AutoFill, perform the following steps:
- Set up your app’s associated domains. To learn how to set up your app’s associated domains, see Supporting Associated Domains.
- Set the correct AutoFill type on relevant text fields. For an iOS app, see Enabling Password AutoFill on a Text Input View. For a web app, see Enabling Password AutoFill on an HTML Input Element.
https://developer.apple.com/documentation/security/password_autofill
Solution 3:[3]
While this DOES allow autofill/keychain to fill credentials on a properly set-up trusted domain through wkwebview, it still does not allow the SAVE/STORAGE of user/pass upon entry. This behavior is strange - meaning one can use their web credentials to sign into an app which also includes this domain as trusted, but the user cannot save their user/pass FROM the app/wkwebview despite it being trusted. There is no documentation from Apple explaining this discrepancy - and many have the same issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Hwangho Kim |
| Solution 2 | Bart Verkoeijen |
| Solution 3 | JeffZ |
