Open External Links in a New Tab
Currently all links open in the current tab/window. I think links that don't contain the domain Talkyard resides on/in should open in a new tab with the _blank attribute in the Markdown/HTML links that are made.
- 3 replies
Hmm that makes sense, after all, Talkyard is a single-page-app, and a bit state, is lost, if opening an external domain directly in the same browser tab.
Maybe this should be a config value — I usually think websites that by default open in the same tab, feel more "honest" — because they are kind of more okay, with the user leaving their site. So, both viewpoints: opening in the same tab, or a new, has their own benefits.
Then there's also
rel=followor not, for external links. I've seen other software has a whitelist of domains to which all links are made rel=follow. Maybe I could add this whitelist value, and an external link config value, at the same time.
I definitely think this should be an option. A dialog for making a link could also work in the Reply area, allowing a user to check a box that says soemthing like 'open in a new window'. And when that option is chosen, an icon indicating an external link could be placed near the end of said links.
A link editor sounds like something that's needed. For example if one clicks
ctrl + kover at Quora, or in Gmail, then a small link editor dialog opens — where one can edit the title of the link, and the URL. And there could also be checkboxes for making it
[ ] Open in a new tab, and ... for attachements, maybe one would want to specify the name of the downloaded file, i.e. the html5
And yes an external link icon would be good, for those external links.
For a start, maybe "just" an admin checkbox that makes all external links open in new tab. Maybe better to wait with a real link editor, until after Prose Mirror (that's a combined Rich Text + Markdown) is in use, and maybe even someone will build a ProseMirror link editor (for some other different project) that Talkyard can reuse.