I am currently working on chrome extension which can auto-fill and auto-login and I have figured a way out for detecting and submitting the login info but now there are many websites which have popup login such as twitter.com some have single input submit like amazon.com. It is working on many websites but it also puts a lot of load on the tab. How can I solve the performance issue?
to detect input fields I have used type = password,email,text with the non hidden attribute and to find submit button I have used below logic to find submit button
const buttonElementsList = ['input', 'button', 'a', 'p', 'span', 'div',];
document.evaluate(`//${buttonElementsList[i]}[contains(.,'${btnText}')]`, mutation.target, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
// btnText picks one everytime from below array
[
"Log In",
"LogIn",
"LogIN",
"log in",
"login",
"log IN",
"Login",
"LOG IN",
"LOGIN",
"Log in",
"Log in ",...]
to keep an eye on the dom tree to look for popup based login I have used Mutation Obersver
manifest version is 3.
Thanks in advance