如何在macOS上支持用户名/密码自动填充?

时间:2019-02-17 15:56:55

标签: macos cocoa autofill

可以检测用户是否安装了密码管理器。如何在macOS上处理用户名/密码自动填充?如何使用NSSecureTextField支持iCloud钥匙串?

NSURL *URL1 = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"com.agilebits.onepassword4"];
NSURL *URL2 = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"com.lastpass.LastPass"];
NSURL *URL3 = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"com.dashlane.Dashlane"];
NSURL *URL4 = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"org.keepassx.keepassx"];
NSURL *URL5 = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"com.agilebits.onepassword7"];

    //iCloud Keychain ????

if (URL1 || URL2 || URL3 || URL4 || URL5) {
        //has password manager
    }

0 个答案:

没有答案