Topic on Project:Support desk

External link opens in new window on request but not always :-(

6
Casablanca1950 (talkcontribs)

Hello All,

I installed the LaunchExternal extension in my Wiki, and now any URL in a text opens in a new window, BUT the one to MediaWiki. How come ?

Example:

In this page link to Forum de discussions et d'informations does open in a new window, but in that page (4th §), link to MediaWiki does not :-(

Config is


MediaWiki 1.24.1
PHP	  5.5.11 (apache2handler)
MySQL	  5.0.67-log

Thanks.

Ciencia Al Poder (talkcontribs)

Assuming you're using the script on that page instead of the <ext></ext> tag, it had an issue. I've updated the script on the page and it should work if you update it.

Casablanca1950 (talkcontribs)

Hi,

I don't understand. You updated a 20 lines script by a 5 lines one, which does the same?

I'm using the LaunchExternal script. Should I remove it from Common.js and copy/paste the script from your page instead?

I was not able to do so as right click and CTRL C are disabled on your page.

Thanks.

Ciencia Al Poder (talkcontribs)

Yes, replace the old script with the new one and it should work. Be sure to hard-reload the page (CTRL+R) or clear the cache to ensure it gets loaded.

And yes, I managed to simplify the script by using jQuery, which is loaded by default on MediaWiki and provides a lot of shorthands to do the same in fewer lines of code :)

Casablanca1950 (talkcontribs)

Clever, Buddy :-)

I did it, the feature still works, but the link to MediaWiki still opens in the same tab...

Thanks.

Ciencia Al Poder (talkcontribs)

Ok, the footer icons are special, so I've updated the script to handle them.

Reply to "External link opens in new window on request but not always :-("