浏览器中的 "Open link in new tab" 与 HTML 中的 "target=_blank"

"Open link in new tab" in browser vs. "target=_blank" in HTML

我正在为 Outlook Web Access 开发一个插件。我的插件只是一个使用带有 target='_blank' 标签的按钮,它将用户发送到另一个页面。基于 Microsoft 的 document

In supported Web clients, such as Excel Online and Outlook Web App, Office Add-ins are hosted in an iframe that runs using the HTML5 sandbox attribute. ActiveX components or navigating the main page of the web client are not allowed. Office Add-ins support is enabled in the web clients by the integration of the JavaScript API for Office. In a similar way to the desktop client applications, the JavaScript API manages the add-in lifecycle and interoperability between the add-in and the web client. This interoperability is implemented by using a special cross-frame post message communication infrastructure. The same JavaScript library (Office.js) that is used on desktop clients is available to interact with the web client.

由于提到的Sandbox,当点击link时,目标页面无法正常显示,只能部分显示。令人惊讶的是,如果我右键单击相同的 link 和 select“在新选项卡中打开 link”,目标页面显示正常而不会丢失其内容。

我的问题是: 在 HTML 中使用属性 target='_blank' 和在浏览器中 select 使用“在新标签页中打开 link”选项有什么区别?以及我如何模拟“在新选项卡中打开 link”选项以使我的插件工作而无需用户右键单击 link。

P.S。我在 Firefox 和 Chrome 中都试过了,它们有相同的行为。

target="_blank" 通常会在浏览器配置指定的位置打开 link。据我所知,没有办法控制它在标记本身中的工作方式。您是否在多个浏览器中尝试过? 编辑:为了模拟 "open in new tab" 功能,target="_blank" 是正确的。