0

I have this issue where if I click do a manual click of a button using my mouse, the browser will load the next page with an iframe with the appropriate URL. However if I use an autoclick (like .click()) then it will load the next page then continue to redirect and load the iframe URL in the top frame.

I noticed that the manual click actually has chrome blocking the redirect while the autoclick does not have chrome blocking the redirect. How does chrome know if I clicked with my mouse vs using .click()? And is there a way to imitate the manual mouse click? Or to prevent the redirect using javascript? I was thinking trying to wait until the next page loads then doing preventDefault() or something like that.

Also worth noting that I don't own the website code. I'm working on a program that overlays on top of the site I'm on so I kind of have to work around changing html.

Edit: adding code for visual. first chunk is the website code im working with.

<a target="_self" href="iframeUrl">
   <img border="0" src="/imageURL">
</a>

Using $0.click() is what I'm doing but it keeps redirecting when I get to the next page.

ryvn
  • 1
  • 1

0 Answers0