You can check this post to create a custom infobox.
Another approach you can do is: You can disable default infobox by setting it’s property to false and create own div (without appending that into viewer.infobox) on triggering selectedEntityChanged
event.
viewer.selectedEntityChanged.addEventListener(ent => {
// your code here..
});
It seems like you are trying to open external page in a iframe. Try this and let me know here if it works or not.
<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="http://google.com"></iframe>