保存密码弹出铬浏览器

Save password popup chrome browser

本文关键字:浏览器 密码 保存      更新时间:2023-09-26

我正在开发一个chrome扩展,它需要显示弹出窗口来保存任何特定网站的密码。

请考虑以下情况1) 用户在浏览器中打开了www.facebook.com。2) 点击登录按钮。3) 用户已登录。Chrome浏览器本身提供了"保存密码"选项。4) 在这个阶段,我希望我的插件显示一些自定义弹出窗口来保存密码。

现在的问题是,我的插件是如何知道用户已经登录到某个网站的。或者chrome浏览器是如何知道用户登录到某个网站并显示弹出窗口来保存密码的。

如有任何帮助,我们将不胜感激。

感谢

I am able to solve my problem.I am posting my answer,that might be helpful to others also. 
So in my case, I want to know that some user has logged in to some website.Here website is not fix, it could be any random website.
So, in order to know, user has clicked "Login" button, i am adding eventListener to window through my content script.
My code is as follows:
window.addEventListener('click', function() {
    console.log(this);
});
In the above code you have the element("this") which is clicked.
You can now check id, text,button title of "this" to check if it is "Login" or not.
If its "Login", then user hit the login button.