# פתח קישורים פנימיים באותה לשונית דפדפן

**URL:** <https://meta.discourse.org/t/open-internal-links-in-same-browser-tab/172353>\
**Category:** Product Support\
**Created:** [5 בדצמבר,‏ 2020,‏ 11:01pm UTC](https://meta.discourse.org/t/open-internal-links-in-same-browser-tab/172353 "2020-12-05T23:01:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)\
**Post date:** [17 בפברואר,‏ 2021,‏ 12:22am UTC](https://meta.discourse.org/t/open-internal-links-in-same-browser-tab/172353/4 "2021-02-17T00:22:55Z")

</div>

What’s the best way to do this Rafael?

I tried using:

```plaintext
<script type="text/discourse-plugin" version="0.8.42">
	api.decorateCookedElement(
	  element => {
	    const tags = element.querySelectorAll('.hashtag');

	    tags.forEach(function(tag) {
				if (tag.hasAttribute('href')) {
					if (tag.href.includes("site.com/tag/")) {
						tag.href = tag.href.replace("site.com/tag/", "newsite.com/")
						tag.setAttribute("target", "_self");
					}
				}
	    });
    },
	  {
	    onlyStream: true
	  }
	);
</script>

```

and while:

```plaintext
tag.setAttribute("target", "_self");

```

sets the attribute it doesn’t not have any impact, with links opening in a new tab as normal.

I guess I need to use something other than `api.decorateCookedElement`?

---

_[View the full topic](https://meta.discourse.org/t/open-internal-links-in-same-browser-tab/172353)._
