Behaviour of external links for not logged-in visitors

pr-welcome

(arajvanshi) #1

I selected the setting default_external_links_in_new_tab in the admin area. This resulted in the expected behaviour of setting default preference of all new users set to ‘open external links in new tab’.

However, for non-logged-in visitors, the behaviour is still the old one, it is opening the external links in the same tab leading visitors to go away from the website. When admin selects the default_external_links_in_new_tab setting, it should change the behaviour for non-logged-in visitors as well.


(arajvanshi) #2

Any update on this issue? Anything I can do to fix this locally?


(Dave McClure) #3

The default_external_links_in_new_tab setting was added relatively recently. Before that, only end users could change this via their user preferences.

I am guessing the issue is that when that setting was added, it was implemented such that when a new user is created, their initial preference is set.

But the logic still holds that the setting is only effective for the current user via their preferences.

This may or may not have been a conscious decision, so I think you should recategorize this topic as a “feature” request.


(Kane York) #4

I knocked together a quick PR:

https://github.com/discourse/discourse/pull/2278

The ‘false’ behavior was from acting on an undefined value returned from Discourse.User.currentProp() when there is no current user, so it seemed to me to not be intentional one way or the other.


(Barnabas) #5

Non logged in users still not able open external links on new tab.


(Yağız Öztürk) #6

Is there any update plan on that?


(Prem Anand) #7

Is this feature available yet?


(Sam Saffron) #8

@riking what is going on here?


(Kane York) #9

We still have the problem behavior mentioned in the OP.


(Sam Saffron) #11

#pr-welcome here, I do not think this is bug proper, rather expanded functionality for anon.