Insert Javascript Tag in iFrame?

I am trying to insert a broadband speedtest on our website. Neither of the two I have identified are working well in iFrame’s. One, nPerf, will load but is reported as an unlicensed use by nPerf.

nPerf instructions below.

Here is the JavaScript tag to insert in your webpage, between the tags of your HTML code:

Having double checked with nPerf, they are quite clear that you cannot just put the above code in an iFrame.

I am able to get nPerf to work correctly by adding the code by Embedding Custom Code via Main Dashboard > Settings > Custom Code > Add Custom Code > Specific Page > Body Start

The problem now is that the add-in is inserted at the top left hand side of the page, and not where I need it to be. However, the add-in is no longer reported as unlicensed. So, progress of sorts.

An alternate option is Ookla’s Custom Speed Test. This is currently refusing to display anything at all in an iFrame. Here again I can “fix” the problem by inserting the code via Embedding Custom Code as above.

Any ideas how might work my way round this one?

Not so much an answer as an inelegant work around. This works for BOTH of the broadband speed test add-ins I am trying.

Create a blank page - no headers, footers, not in your menus, etc.

Publish your site

Get the URL of the blank page you have created

Put the Javascript in the of just that blank page via the Add Custom Code route

Put an iFrame on whatever page you actually want the Javascript add-in to operate/appear to users

Set the website address/URL for the iFrame to the blank page / URL you created above.

Everything will work OK, except having to try to make the actual “appearance” of your iFrame look OK… That’s my next job, to see if I can find a way of making it “neat”. Not sure I can, but we can but try.