@Wiz Test this code I hope I was not wrong anywhere
JavaScript:
await Delay(5000);
await WaitForLoading();
if ( await EvaluateScript("document.getElementsByClassName('specific-сlass').length > 0;") ) { // check 'specific-сlass' exist
// 'specific-сlass' exist
} else {
// 'specific-class' not found
tabs = await TabCount(); // close all tabs if exist
while (tabs > 1) {
await TabFocus(tabs--);
await Delay(100);
await EvaluateScript("setTimeout(function(){var ww = window.open('about:blank', '_self'); ww.close();}, 500);");
}
await TabFocus(tabs);
Exit(); // close main tab
}