force target="_self" on dynamic extrnal cross domain in iframe

I have a site on kiosk mode on chrome using iframe in which I am opening number of external sites. And each of the sites has their own links with target=”_blank”. I have no control on those external links.
I want to open all those external links inside iframe only or I would need to publish some message for those target=_blank links. I can’t open new window on kiosk. I have searched so far and found it has to be some server side coding. Javascript won’t be any help in that.

My iframe code:

        Engine.ui.mostRecentSection = "external";

        $("a[data-navsection], a[href]").removeClass("disabled");
        $("a[href='" + href + "']").addClass("disabled");


       var sandbox = "sandbox=\"allow-forms allow-scripts allow-same-origin\"";

         $("#content-container").append("<iframe id=\"contentFrame\" src=" + href + "\"" + sandbox + "></iframe>");

Any help or suggestion would be really great.

Thanks in advance!!

Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.