# Open results in a new window

**URL:** <https://discuss.elastic.co/t/open-results-in-a-new-window/270426>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [April 16, 2021, 9:43pm UTC](https://discuss.elastic.co/t/open-results-in-a-new-window/270426 "2021-04-16T21:43:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nifsight](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nifsight/32/87204_2.png) [@nifsight](https://discuss.elastic.co/u/nifsight)\
**Post date:** [April 16, 2021, 9:43pm UTC](https://discuss.elastic.co/t/open-results-in-a-new-window/270426/1 "2021-04-16T21:43:29Z")

</div>

We would like PDFs and documents to open in a new window rather than the same browser tab, so customers do not loose a view of our site navigation and their context when documents open from the search page.

We've added JavaScript to set the links open offsite `<a target="_blank" href="....` but it appears `st.js` adds click handlers that override any we set.

Is there a way to do this?

Our code version is

```auto
    <script type="text/javascript">
      (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
      (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
      e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
      })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

      _st('install','zzzzz','2.0.0');
    </script>

```

Thank you

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [May 4, 2021, 7:03pm UTC](https://discuss.elastic.co/t/open-results-in-a-new-window/270426/2 "2021-05-04T19:03:47Z")

</div>

Hi @nifsight !

The easy, official answer: we don't support opening documents in a new window/tab.

The janky, not-recommended, unsupported solution is do do something like this: [Standard Embed Template Override · GitHub](https://gist.github.com/mikeisonthenets/17f1ece455646194d9e7aacc4388eb1d)

Hope that helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2021, 7:04pm UTC](https://discuss.elastic.co/t/open-results-in-a-new-window/270426/3 "2021-06-01T19:04:26Z")

</div>

Closed on June 1, 2021, 7:04pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
