Created
September 25, 2025 17:00
-
-
Save LikeCarter/bcc77e1635ce06f1410398cd857fdba4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Select all elements that match the selector | |
| const pdfButtons = document.querySelectorAll('button.buttonLink.ng-star-inserted:not([disabled])'); | |
| // 2. Loop through the elements and schedule the click with a delay | |
| pdfButtons.forEach((button, index) => { | |
| // Calculate the delay for each button: 500ms * index | |
| const delay = 500 * (index + 1); | |
| // Schedule the click action after the calculated delay | |
| setTimeout(() => { | |
| // Ensure the element is still valid and visible before clicking (optional but good practice) | |
| if (button) { | |
| console.log(`Clicking button ${index + 1} with a delay of ${delay} ms...`); | |
| button.click(); // Simulate the mouse click | |
| } | |
| }, delay); | |
| }); | |
| // Optional: Inform the user that the process has started | |
| console.log(`Scheduled clicks for ${pdfButtons.length} buttons with a 500 ms interval.`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment