Disabling target=“_blank” in iframe from opening n

2019-08-11 21:28发布

问题:

I have an issue-

I'm creating an html 5 app and including external websites in with an iframe. Inside the external website some of the links have

target="blank"

When clicked, this exits out of my app and opens up and entirely new window. Ideally, I want to keep them inside the iframe which allows them to use my app navigation (and is the point of an app).

Unfortunately I don't think I'm going to be able to achieve this with frontend technology alone. I'm looking for ANY solution. What I need is to basically get the "iframe" to act as its own window and my nav to be an entirely separate piece.

My current code base is html5, css, javascript, php (but possibly looking into integrating in node.js).



Here is a fiddle showing the issue: http://jsfiddle.net/zmx9e/

标签: html iframe