# Open New Window/Tab via API

**URL:** https://meta.discourse.org/t/open-new-window-tab-via-api/143964
**Category:** Support
**Created:** [March 11, 2020, 9:01pm UTC](https://meta.discourse.org/t/open-new-window-tab-via-api/143964 "2020-03-11T21:01:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jordan.vidrine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan.vidrine/32/515563_2.png) [@jordan.vidrine](https://meta.discourse.org/u/jordan.vidrine)
#### Post date: [March 11, 2020, 9:59pm UTC](https://meta.discourse.org/t/open-new-window-tab-via-api/143964/2 "2020-03-11T21:59:38Z")

</div>

This may help.

> [@Customized header link target attribute being ignored](https://meta.discourse.org/t/customized-header-link-target-attribute-being-ignored/57380/7):
>
> Oh this is interesting, if you take that code and change it to \<script type="text/discourse-plugin" version="0.4"\> api.decorateWidget('header-buttons:after', helper =\> { const showExtraInfo = helper.attrs.minimized; if(!showExtraInfo) { return helper.h('a.blog-link', {href:'https://blog.example.com', target:'\_blank'}, 'Visit our blog'); } }); \</script\> It will open in a new window just fine. So there seems to be a difference in how the clicks are handled when i…

---

_[View the full topic](https://meta.discourse.org/t/open-new-window-tab-via-api/143964)._
