开发者

Enforce iframe to open its links inside the frame

开发者 https://www.devze.com 2023-04-11 20:15 出处:网络
Is there a way to enforce iframe to open its target=\"_blank\" links inside the frame and开发者_StackOverflow中文版 not open a new window/browser-tab?

Is there a way to enforce iframe to open its target="_blank" links inside the frame and开发者_StackOverflow中文版 not open a new window/browser-tab?

Thanks.


You can write a bit of JavaScript, made easier using a framework such as jquery, that just removes that attribute from each link on the page. Does that suffice?

UPDATE: OK, so following your clarification, and having done a quick test, I believe the answer is "no". You'll get a permission denied error when trying to access the iframe's document via javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消