强制链接在新窗口中打开 [英] Force links to open in a new window

查看:92
本文介绍了强制链接在新窗口中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的网站中,我们嵌入了PDF,我们希望确保当用户单击PDF内的链接时,该链接会在新的标签或窗口中打开.我们无法控制PDF,因此我们无法对链接本身做任何事情.

In our web site we have embedded PDFs, and we would like to make sure that when the user clicks a link inside the PDF, it opens in a new tab or window. We have no control over the PDFs so we cannot do anything with the links themselves.

是否可以通过某种方式(例如使用onbeforeunload)拦截请求,并强制新页面在单独的窗口中打开?

Is it possible to intercept the request in some way, for example with onbeforeunload, and force the new page to open in a separate window?

推荐答案

对不起,没有办法.

这是设计使然.

如果可能的话,这将是重大的安全漏洞.

If it was possible it would be a major security breach.

这篇关于强制链接在新窗口中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆