1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Open All Links (even internals) In New Tab 1.0.0

Open all links in your xenforo in new tab

  1. Dadparvar

    Dadparvar Well-Known Member

    Dadparvar submitted a new resource:

    Open All Links (even internals) In New Tab - Open all links in your xenforo in new tab

    Read more about this resource...
     
    tosalem and 51463 like this.
  2. Dadparvar

    Dadparvar Well-Known Member

    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>
     
    viper357, tosalem and 51463 like this.
  3. viper357

    viper357 Active Member

    Thank you very much for this. :)
     
    Dadparvar likes this.

Share This Page