Yes. Like the title said.
function selectOption(f){
const a = document.querySelector('.DropdownOption');
if(a===null){
return setTimeout(selectOption.bind(null, f), 1);
}
a.click();
setTimeout(f, 1);
}
function selectLabel(label, f){
label.click();
selectOption(f);
}
function selectLabels(labels, f){
function _do(){
if(labels.length === 0){
return f();
}
const l = labels.shift();
selectLabel(l, _do);
}
_do();
}
function selectAll(f){
selectLabels(Array.from(document.querySelectorAll('.DropdownLabel')), f);
}
function loop(){
if(document.querySelector('[draggable="false"][alt="next"]') !== null){
console.log('Done!');
return;
}
selectAll(() => {
document.querySelector('[alt="next"]').click();
setTimeout(loop, 100);
})
}
loop();