Replace / change links within iframes


I’ve got an iframe on my page that displays my affiliate’s webpages (located on their domain).

Two concerns:

First, all links within the iframe reveal their domain name in the status bar and in the page source, i.e. <a href=“”>.

Second, the links in the iframe have target=“_blank” which opens new tabs/windows, also exposing their domain to my customers.

Would it be possible to replace all instances of “” inside the iframe to “”; whereas, “” will be a proxy forwarding requests to “”? Keep in mind that these elements do not have ID or Class.

Any advice is welcomed!

Can any other languages do the job?

JavaScript has no access to the page in the iframe when it is a different domain.