clarkwinkelmann I'm not sure how it got introduced
This is part of protection against "target _blank vulnerability" - FF does not support noopener
attribute, noreferrer
should be used in this case.
clarkwinkelmann I'm not sure how it got introduced
This is part of protection against "target _blank vulnerability" - FF does not support noopener
attribute, noreferrer
should be used in this case.
clarkwinkelmann If we add a setting for that in core, then we will have made it more bloated than before, which is the opposite of what we want to do here.
I don't know, I don't think that adding a toggle button in the admin will make it "more bloated"... It's just an option to make the platform more customizable, as there are many others already. If an extension did that it would be fine anyway
010101 think it is fine for external links inside of posts to open in a new window. But, I don't think I care much either way. About that part in particular.
I agree with this all external links should open in a new tab. I want to keep users on my flarum,and always make it easy to get back to the post they were reading.
clarkwinkelmann This is probably one of the reasons Flarum has been opening links in new tabs since so long. I feel that if Flarum doesn't handle the back button properly, then it should be reported and fixed as its own separate bug. Forcing a new tab just to avoid that seems like trying to avoid fixing another existing problem.
In my opinion, that ship has sailed a while ago. Due to several large websites following that path (Facebook, Twitter, Google's image search, Google Map) the convention to open links to external sites in a new window has been established already for a large proportion of internet users, and we are not going to change that. We just have the freedom to fulfill the expectations of our users or to follow a route based on more or less ideological grounds.
In the meanwhile I found the time to go through the comments below the css-tricks article. There are a lot of comments arguing in either direction, but the ones that stood out to me tend to support my point of view.
Jeff Rainey # January 16, 2014
@ChrisCoyier I totally want to agree with you and in theory it makes practical sense. But, @TimSeverien makes an excellent point. Facebook, Twitter, Google+ and other major social outlets use _blank linking as the default behavior. Has the prevalent use of _blank already changed what the “regular user” expects? These users spend a large amount of time on Facebook using _blank for every external link they click.
@nate I don’t think Tim is saying he is making the decision. I think he is saying it was already made by Facebook and the like. If this is true, then us deciding to not use _blank for external links goes against what Facebook, Twitter and Google+ do and against what the “regular user” would expect. [...]
Eric Shields # February 20, 2014
This right here is exactly how I feel on the subject. I am an experienced web user and I know a great many fancy key commands, but even I find myself closing tabs and wondering where the hell what I was looking at before went. Why? Because I clicked a link to a full screen image, a cat video, or a different site altogether. It just makes sense that those should be in new tabs.
Now, we can argue till our faces turn blue about what the situation should be, but take a look at what your users expect and build your UX around that. I suspect you’ll find that a large majority of the web will expect the internal vs. external differentiation.
Given how prevalent target="_blank" is; I don’t see “My client wants it that way” to be a bad argument whatsoever. As many have already pointed out, this mechanic is arguably considered an industry standard. Clients are going to see links on other sites behave in this manner and then ask why their own links are not.
I could give the most eloquent technical answer in the world; but at the end of the day it boils down to arguing that everyone else is doing it wrong. Stepping away from the expected can be beneficial, but I think this would be a hard argument to win and frankly, not worth the hassle in most cases.
Now if more sites adopted this mentality it would be another story. That won’t happen without convincing evidence that users find links opening in a new tab to be as you stated above: a nuisance, breach of trust, etc. I am assuming that this article is based more on opinion than polling but if I’m incorrect on that I’d love to read more about said polling; what users like/hate is always fascinating.
and one more:
If you want your site to “work like an app” then _blank is a pragmatic reality to avoid breaking the illusion.
Imagine if clicking a link in outlook opened IE and closed outlook.
Even though the back button is in theory your breadcrumb trail back, you’re SOL if you wander down a rabbit hole, end up on a site that aggressively redirects, find a site that hijacks the history, or ever accidentally close the window or tab. [...]
I understand that opinions vary a lot on that topic, probably mostly due to one's own tech savvyness. Regarding Flarum I think there should be an option for the webmaster to make a decision based on their targeted audience. Whether this should be part of the core or a bundled extension, I don't care too much.
clarkwinkelmann I know this has always been an issue. And if we implement this change it still won't fully solve it because internal links will still trigger a full page reload instead of navigating inside the single page app (I think). We need to handle this separately (is there already an issue for it ?)
I saw it as a side effect of the policy to open links in posts to a new window. Opening these links in the same window but with a full page reload seems doubly ackward to me. I can't believe it should be too difficult to have Luceos behave like luceos.
I probably prefer to have links to the current flarum installation or current domain opened in the same tab. Other links should be opened in a new tab.
Clicking a link in the forum to an external page takes the user away from your own site elsewhere. Not a great experience
From my point of view and taking care about forum SEO, the right choice is open "external links" in a new window and open "internal links" into same window. This is the right way to do this.
I agree with luceos. Links opening in a new tab also make it clear that you're going to an external site, most likely not affiliated with the current one (specially as the link will be user-provided as this is a forum).
Some websites add external link warnings (eg Steam), however that is most likely because they are big and get a ton of scams.
I have never had any issue with links on websites being opened in new tabs, however if some do, perhaps the best idea would be to make this a user preference. DuckDuckGo, albeit a search engine, allows users to configure whether they want results to open in a new tab or not.
I am in IT, and we deal on a daily basis with users lacking basic IT knowledge.
We all know to use middle-click (or right click) to open a new tab, but i think at least 60% % of the internet users dont know it, so that argument is gone i think.
As a flarum user i think forcing all links in the same tab would be bad for our users, so dont do it.
If you want to do this, make it an option in the background so admin's can choose the behavior they want.
luceos comment makes the most sense: flarum-urls from the same board should go to the same window, external URL's should go to a new TAB file, but to be honest... we hardly see our users post links to other topic's on our forum, because most refferences are inside a topic, and due to the functions of mentioning users, quote users etc this all goes perfect without the use of the URL's
I implemented my flarum as a Progressive Web App (PWA) so now the members can "install" the app in their smartphone homescreen. When using the homescreen icon, the forum opens in a "standalone" browser window without address bar, status bar and other browser ui, almost like a native app. I had a problem because all internal links were opening in a new window and displaying all browser ui again. No good for UX. So, my opinion is that external links should open in a new tab and internal links should open in the same tab.
By the way, i "fixed" the "problem" with this aditional script in the custom footer:
document.addEventListener('click', event => {
let t = event.target;
if (t.matches('.Post-body a[target="_blank"]')) {
let url = new URL(t.href);
if (url.origin == document.location.origin) {
t.removeAttribute('target');
t.removeAttribute('rel');
}
}
}, false);
Edit: dont know how to fix code indentation.
luceos I probably prefer to have links to the current flarum installation or current domain opened in the same tab. Other links should be opened in a new tab.
This.
When there are instances that users want to open an internal link in a new tab (e.g. other discussions, admin panel) then they should use built-in browser behavior.
External links should follow standard internet behavior and open in a new tab. Keeping visitors on your site is important to keep discussions going, and _self links are likely to be more useful for site visitors rather than site members depending on the community, so using _blank behavior gives your visitors another reason to look at your site again.
Powermage I also work in the IT industry (CISO / Director) and agree 100% with your synopsis.
I have html5 video links of videos I host on another server and domain which I want them to open in the same tab, not in another tab like it is doing now. So that when they close the video, they will land back on the forum discussion from where they clicked the video link on, and not in some empty tab. I have decided not to embed the videos in my discussions as my videos are portrait and are just increasing the scrolling and loading time. And also clicking on the mp4 links is directly playing the videos fullscreen height in desktops also which is what I want, so it it is much better than embedding. Please how can I disable this _blank target for all links? Please help. I think I can't force a self target with bbcode links also right? I don't know how to do this.
I am an advocate of always keeping all links internal or external to open in the same tab. If they want to open a link in another tab they can always hold it and tap on open in new tab. Imho this is what is called giving the visitors the choice and not forcing them to toggle between tabs just because we think it is the right thing to do for external links. Even if an external link opens in the same tab, they can always use the back button in the browser to come back to the forum page. In fact, they can't use the back button to come back if it opens in another tab which is actually more frustrating.
They are many articles online which say the same thing. Don't force on the visitors what you think is the best and they will be more comfortable to visit again. And new tabs opening even with external links is certainly going to annoy many visitors. If they like the discussions, they will surely tap the back button to come back and participate even if they go to an external link in the same tab. We always find our way back to things which interest us. No one has to force us to do that. And if they don't like the discussions, then even if the external link opens in another tab they won't come back to the discussion. If they feel it will be too hard to come back to the post position in the discussion they are on, then they could always tap and hold on the link and open it in a new tab. This is what I feel.
This worked:
$ grep -n _blank ./vendor/flarum/core/src/Formatter/Formatter.php
135: $a->setAttribute('target', '_blank');
nitaaikumar Thanks @Franz. Is there any way by custom css or extension, I can open all the links even the external ones in the same tab at this present time? It is really become difficult to come back to the dicussion for those who tap the external self-hosted mp4 links in my forum posts as they are opening in blank tabs. It is as if they just leave the forum because the video links are opening in new tabs. Any help would be kindly appreciated. Thanks in advance.
Hey guys, any update on this? Opening the admin tab in the _self instead of _blank seems to be a better UX.
Opening the admin panel in _blank also causes problems in external tools such as Intercom's Guided Tours.
Btw, inspecting the document and changing _blank into _self doesn't seem to do anything and the admin panel opens in a new tab.
danielunited as discussed via Discord, it's a bit of a different thing, and I'm actually not sure whether we have any issue/discussion about that particular link. It might be worth opening a dedicated discussion about this to see whether we want to change the default behavior.
For anyone finding this while looking at changing the admin link behavior, it's actually pretty simple to change it via the javascript API:
// Make admin panel open in same tab
extend(SessionDropdown.prototype, 'items', function (items) {
if (!items.has('administration')) return;
items.get('administration').props.target = '_self';
});
It's one of those features that should be bundled in another extension, because it's almost too simple to be made into its own extension.