Skip to content

Instantly share code, notes, and snippets.

@SophieShears
Last active July 18, 2025 20:31
Show Gist options
  • Save SophieShears/39a918b1f9b7168ae36fb57f4b21041e to your computer and use it in GitHub Desktop.
Save SophieShears/39a918b1f9b7168ae36fb57f4b21041e to your computer and use it in GitHub Desktop.
Click All Links Then Scroll to the Bottom
class OpenAll {
constructor() {
this.seenUrls = new Set();
}
openWindows() {
const links = document.getElementsByTagName('a');
const url = 'crm.kuhnlawgroup.com';
for (let i = 0; i < links.length; i ++) {
if (!links[i].href.includes(url) && links[i].href.includes('.com')) {
if (! this.seenUrls.has(links[i].href)){
this.seenUrls.add(links[i].href);
window.open(links[i].href, '_blank');
}
}
}
}
scrollAndOpen(timesToScroll) {
const windowTable = document.getElementsByClassName('window-table')[0];
for (let i=0; i < timesToScroll; i++) {
this.openWindows();
const scrollDistance = windowTable.scrollTop + document.body.scrollHeight;
windowTable.scrollTo(0, scrollDistance);
};
};
}
const windowOpen = new OpenAll();
windowOpen.scrollAndOpen(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment