Open New Window/Tab via API

The code below was taken from a reply marked as a solution in a previous topic.

<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>

did you visit this topic reply?

3 Likes