Q: I wanna exit all "browsers" if a specific "class" is not detected on the page.

opsfafsme

Well-Known Member
Rule The Universe
VIP
Joined
Jul 2, 2018
Messages
243
Reaction score
91
Website
OnlinePiercingShop.com
Achievement
@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
}
 
  • Like
Reactions: wernerk93

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu