Hello,
I have a script that opens several random links from a given page in several tabs.
Say one of them is opened with a facebook page, which I don't want.
Since the opening of links is random and the link is in the page, I cannot stop the macro from opening it every now and then.
So I figured I could at least close it right away, like this:
await ClickRandomlLink ();
await Delay(Random(2500,3000));
await WaitForLoading();
var tabcheck = TabFocus("facebook.com");
if (tabcheck) {
TabFocus("facebook.com");
await ExecuteScript("window.close()");
}
Of course, it doesn't work
tabcheck's value is always "true" no matter wheter the facebook page is in a tab or not.
Any ideas as to how I could get it to work?
Thanks in advance!
I have a script that opens several random links from a given page in several tabs.
Say one of them is opened with a facebook page, which I don't want.
Since the opening of links is random and the link is in the page, I cannot stop the macro from opening it every now and then.
So I figured I could at least close it right away, like this:
await ClickRandomlLink ();
await Delay(Random(2500,3000));
await WaitForLoading();
var tabcheck = TabFocus("facebook.com");
if (tabcheck) {
TabFocus("facebook.com");
await ExecuteScript("window.close()");
}
Of course, it doesn't work
Any ideas as to how I could get it to work?
Thanks in advance!