Skip to content

Commit bbc6744

Browse files
committed
feat(GoogleAutoClickFirstAccountSignIn): bump version to 1.5 and improve account selection logic with dynamic loading messages
1 parent 429ab0b commit bbc6744

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

GoogleAutoClickFirstAccountSignIn.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Automatically Select First Google Account to Sign In
33
// @namespace typpi.online
4-
// @version 1.4
4+
// @version 1.5
55
// @description Selects the first Google account in the Google account selector page
66
// @author Nick2bad4u
77
// @match https://accounts.google.com/*
@@ -19,16 +19,16 @@
1919

2020
// Function to select the first account
2121
const selectFirstAccount = () => {
22-
const firstAccount = document.querySelector('li.aZvCDf');
22+
const firstAccount = Array.from(document.querySelectorAll('li')).find(el => el.textContent.includes('@gmail.com'));
2323
if (firstAccount) {
2424
const firstLink = firstAccount.querySelector('div[role="link"]');
2525
if (firstLink) {
2626
firstLink.click();
2727
} else {
28-
console.log('First account link not found.');
28+
console.log('First account link not found. This might be due to changes in the page structure or the account list not being fully loaded.');
2929
}
3030
} else {
31-
console.log('First account not found on the page.');
31+
console.log('First account not found on the page. Waiting for the element to load dynamically...');
3232
}
3333
};
3434

0 commit comments

Comments
 (0)