Default setting for external links [0.7.0 dev]
-
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 -
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.