Skip to content

Instantly share code, notes, and snippets.

@KunoiSayami
Last active June 24, 2022 06:34
Show Gist options
  • Save KunoiSayami/388a62347847a8cead67a3b97e9fa9da to your computer and use it in GitHub Desktop.
Save KunoiSayami/388a62347847a8cead67a3b97e9fa9da to your computer and use it in GitHub Desktop.
// License by: AGPL-3.0
let buttonText = 'Show more';
let loadTimeOut = 1000;
document.getElementsByClassName('saleitembrowser_SaleItemBrowserHeader_26iQ9 Panel Focusable')[0].scrollIntoView();
function findButton() {
Array.from(document.getElementsByClassName('Focusable')).forEach(element => {
if (element.textContent !== undefined && element.textContent == buttonText) {
element.click();
console.log('clicked');
}
});
let founded = false;
for (element of document.getElementsByClassName('salepreviewwidgets_StoreSalePriceBox_Wh0L8')) {
if (element.textContent !== undefined && element.textContent === 'TH.4X') {
founded = true;
element.scrollIntoView();
alert('Founded');
}
}
if (!founded) {
setTimeout(findButton, loadTimeOut);
}
}
findButton();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment