Created
September 7, 2024 19:17
-
-
Save theaafofficial/cee7cb136783ac800c981371fe5ff8dc to your computer and use it in GitHub Desktop.
Select multiple passwords in ProtonPass website
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
| (async function () { | |
| // Variables based on your input | |
| const totalPasswords = 0; // Total number of passwords | |
| const visiblePasswordsDivs = 25; // Number of divs visible at a time | |
| // Select the scroll container based on the parent class | |
| const scrollContainer = document.querySelector(".ReactVirtualized__Grid"); | |
| // Get the total scrollable height of the container | |
| const totalScrollHeight = scrollContainer.scrollHeight; | |
| // Dynamically calculate the scroll step | |
| const averageDivHeight = totalScrollHeight / totalPasswords; | |
| const scrollStep = averageDivHeight * visiblePasswordsDivs; | |
| // Array to store already clicked divs to avoid re-clicking | |
| let clickedDivs = new Set(); | |
| // Increased delay time to account for slower rendering | |
| const renderDelay = 3000; | |
| // Function to scroll and click child divs | |
| async function scrollAndClickDivs() { | |
| let lastScrollTop = 0; | |
| let maxScrollHeight = scrollContainer.scrollHeight; | |
| while (lastScrollTop < maxScrollHeight) { | |
| let divs = scrollContainer.querySelectorAll("div"); | |
| divs.forEach((div) => { | |
| // If this div has already been clicked, skip it | |
| if (!clickedDivs.has(div)) { | |
| try { | |
| // Click the div and log it | |
| div.click(); | |
| console.log("Clicked:", div); | |
| // Add this div to the clickedDivs set to avoid future clicks | |
| clickedDivs.add(div); | |
| } catch (error) { | |
| console.warn("Could not click:", div, error); | |
| } | |
| } | |
| }); | |
| // Scroll down by the calculated step size | |
| scrollContainer.scrollTop += scrollStep; | |
| // Wait for new elements to render | |
| await new Promise((resolve) => setTimeout(resolve, renderDelay)); | |
| // Update the scroll position and maximum scroll height | |
| lastScrollTop = scrollContainer.scrollTop; | |
| maxScrollHeight = scrollContainer.scrollHeight; | |
| } | |
| } | |
| // Start the scrolling and clicking | |
| await scrollAndClickDivs(); | |
| })(); |
Author
Thanks a LOT for your help. Pretty crazy that there's no way implemented way to do this and this is clutch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're trying to select multiple passwords on a ProtonPass and don't want to select each one manually, you can use this JavaScript script in the browser's DevTools console.
Instructions:
The script will scroll and attempt to select multiple passwords automatically. It might miss a few, but it’s a quick alternative to selecting all passwords manually. Lastly, click the trash button at the end.