how do i enable autofill password for a wkwebview

依然范特西╮ 提交于 2019-12-08 07:16:47

问题


I'd like to enable the "Autofill Password" in my wkwebview. I can't seem to find any documentation or examples online on how to do this.


回答1:


This IS actually doable using 1Password

Steps to implement it in Swift

Add the extension files:

  • OnePasswordExtension.h
  • OnePasswordExtension.m

Then include them using a bridging header:

#import "OnePasswordExtension.h"

Finally, you can use the following in your project

@IBAction func onePassword_btn(sender: AnyObject) {
    OnePasswordExtension.sharedExtension().fillLoginIntoWebView(self.webView, forViewController: self, sender: sender, completion: {(Bool) in
        // error handling
    })
}


来源:https://stackoverflow.com/questions/27734435/how-do-i-enable-autofill-password-for-a-wkwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!