Open All Links (even internals) In New Tab

xF1 Add-on Open All Links (even internals) In New Tab 1.0.0

No permission to download
📀 Resource submitted by: Admin • 💬 Messages: 15975 • 🏆 Points: 113 • 👍 Likes: 56376 • 📀 Resources: 5997
Compatible XF Versions
  1. 1.0
  2. 1.1
  3. 1.2
  4. 1.3
  5. 1.4
  6. 1.5
Hi,

Today I saw some where that some one needed such an add-on.

This is a simple template based add-on that will cause all links in your xenforo to be opened in new tab.
Both externals (that by default are opening in new tab) and internals (that by default are opening in the same tab)

If you just want to Force internal links in threads and posts to be opened in new tab, don't install the add-on (because it forces all links in all places in your site to be opened in new tab). Just Open "message" template of your style and add this code to first line:

Code:
<script>
window.onload = function() {
   if (!document.getElementsByTagName) return false;
   var links = document.getElementsByTagName("a");
   for (var i=0; i<links.length; i++) {
	  if (links[i].getAttribute("class") == "internalLink") {
		 links[i].onclick = function() {
			return !window.open(this.href);
		 }
	  }
   }
}
</script>

Hope to be useful.

Regards
Author
Admin
Size
696 bytes
Extension
zip
Downloads
8
Views
1,821
First release
Last update

More resources from Admin

Similar resources

Open PDF AnimeHaxor
This will make PDF attachments open in the browser.
[Endless Horizon] Advanced Open Graph AnimeHaxor
Adds advanced options for Open Graph meta tags (adding images from [ATTACH] & [IMG] and many more).
[TH] Open Graph Admin
Add various options to improve social network integration with Open Graph

740Threads
2,311Messages
67,967Members
lewelLatest member
Back