Default setting for external links [0.7.0 dev]
-
@Hägar said:
Maybe i should better file a bug for that?
Good idea.
https://github.com/NodeBB/NodeBB/issuesPlease remember to add a note about Browsing Settings > Open outgoing links in new tab?
-
@Hägar said:
Don't conclude from your own behaviour to someone else. I can tell you the opposite experience with some of my users.
But ain't you doing this too?
I completely agree with @a_5mith in this case. I hate it when websites overwrite the default behavior without good reason.If you force opening within new tab you're limiting the possibilities for users since there is no simple/common way to open those links within the same window.
Since NodeBB is saving your composer-content between sessions there shouldn't get any fatal mis-behavior out of this.
The best solution would be marking external links with an external-link icon (which sadly isn't supported native by NodeBB (yet)) so users who want it getting opened within a new tab know what to do.Besides this setting I'd like to see default user settings implemented in a plugin (but would really hope that admins don't turn that specific setting on by default).
-
Since NodeBB prevents me from submitting my ironic edit of that post above I have to send it within a lonely post:
EDIT: Or the default-settings plugin may kill the whole server (or NodeBB instance if run without root-privileges) once the admin tries to enable this by default
ping @julian @baris @psychobunny : When trying to edit the post above I encounter "Title has to be longer than 3 char"-Alert...
-
Since NodeBB is saving your composer-content between sessions there shouldn't get any fatal mis-behavior out of this.
Except users in panic, which are flooding your inbox with support requests...
The current behaviour is unpredictable.
-
you may add an external-link icon using the following custom LESS:
@external-link-icon-hover-color: red; @external-link-icon-size: 6pt; @external-link-icon-spacing: 1px; @fa-var-external-link: "\f08e"; a[href^='http://'], a[href^='https://'], a[href^='//'] { &:after { display: inline-block; font: normal normal normal 0 FontAwesome; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transform: translate(0, 0); vertical-align: 50%; content: @fa-var-external-link; margin-left: @external-link-icon-spacing; font-size: @external-link-icon-size; } &:hover:after { color: @external-link-icon-hover-color; } }
-
of cause you could use whatever selector you need instead of
a[href^='http://'], a[href^='https://'], a[href^='//']
, I don't know your specific domain-name to exclude full-referenced URLs to that same domain -
I have tested it in "Chats" and when you go back the chat is closed and you have to reopen it. So yes, it can be an issue for new forum users.
-
Initially, yes, I am against hijacking the user preference for this as the expected behaviour is to open in the same page.
And as @a_5mith has mentioned, it is a quasi-standard to use shift/ctrl-click to open in a new tab.
Of course, that said, not everybody is aware of this, and it's especially a problem when you have anchors opening in the same page while you are in a stateless area of NodeBB (e.g. chat or composer open).
So I'm relaxing my stance against having system-wide defaults for link actions...
-
It's a bit off-topic but still related to default settings for external links. I haven't tested the acp of 0.7.0 yet and I was wondering if there was something like a whitelist for external links? Then if someone click on an external link we can activate the warning page "you are leaving the forum", but if it's a sub domain, a root domain or a trusted url (youtube) for example we don't show this page.