且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JavaScript可以访问自动填充的密码吗?

更新时间:2023-02-04 09:52:58

Chrome在两种情况下会自动填充详细信息:

Chrome autofills details under two circumstances:

  1. 明确告知要记住特定网站的凭据
  2. 看到字段时,它认为它可以自动填充,并且用户接受建议的值(并且这些值将不是密码)
  1. When explicitly told to remember credentials for a specific site
  2. When it sees fields it thinks it can autofill and the user accepts the suggested values (and these values won't be passwords)

尽管这些字段可以被JavaScript读取,但没有用户的明确指示,就不会填充这些字段.

While the fields can be read by JavaScript, they won't be populated without an explicit instruction from the user.

这的确增加了风险级别,因为用户可能会错误地意外确认数据,因此该级别被认为是低的.

This does increase the level of risk, because a user might accidentally confirm the data by mistake, the level is considered low.