-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaddJob.js
More file actions
37 lines (26 loc) · 926 Bytes
/
Copy pathaddJob.js
File metadata and controls
37 lines (26 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var firstMatch = null;
let clickCount = 0;
function getButtons(){
const buttons = document.querySelectorAll('[aria-label]');
// Find the first button where `aria-label` includes both "add" and "work"
firstMatch = Array.from(buttons).find((button) => {
const ariaLabel = button.getAttribute('aria-label').toLowerCase(); // Case-insensitive
return ariaLabel.includes('add') && ariaLabel.includes('work');
});
}
function clickButtonWithDelay() {
if (clickCount < 5 && firstMatch != null) {
firstMatch.click();
clickCount++;
setTimeout(clickButtonWithDelay, 1000); // Wait 1 second before next click
}
}
setTimeout(() => {
let nextButton = document.querySelector('[data-automation-id="bottom-navigation-next-button"]')
nextButton.addEventListener('click', () => {
setTimeout(() => {
getButtons();
clickButtonWithDelay();
}, 5000);
});
}, 5000)