Webviewer detect redirection and when it gets different domain show another screen or another result instead of redirection.

I am making an app with a web viewer. in the domain, there is some redirection to another domain but I don’t want to redirect to that app I want to show another result instead of a redirect. can anyone help me with that?

I use these blocks but I am getting errors while launching the app

Error says:

Select list item: List index too large
Select list item: attempt to get item number 3 of list of length 1 : (about:blank)

It doesn’t appear on Live testing. when I download and install the app it comes.
Thank you.

check the length of the list before selecting the 3rd item