(no title)
SnowLprd | 12 years ago
Why does the link to the project on GitHub open in a new browser tab? Is there some reason this behavior is foisted on folks who would rather have the content open in the same tab? (Spoiler alert: I'm one of those folks.)
And, now that I take a closer look, it seems that every non-internal link on the page behaves the same way, spawning new tabs willy-nilly.
Looks like a useful project. I'm just legitimately curious why people do this.
philipwalton|12 years ago
I use Google Analytics to track where users are clicking, specifically, when users click on external links that aren't otherwise tracked by the GA tracking code.
The problem is that if you click on a link that opens a new page, the functionality in the click handler may or may not run depending on how long it takes to redirect the request. That means that if I'm tracking clicks, I very well may be losing a good deal of data.
The alternative is to hijack the click event, wait for say 100ms, and then load the new page via JavaScript, but that also break the open in a new tab functionality.
In other words, there are no good options to track external click events via Google Analytics and still give users complete control over where the links go.
The best option I could come up with is to always open external links in a new tab, because that way the click handling code always has time to run. If you're curious as to what I'm doing, here is the code: https://github.com/philipwalton/solved-by-flexbox/blob/maste...
Anyway, it has nothing to do with wanting users to stay on my site. But I can't speak for why other people do this.
SnowLprd|12 years ago
Perhaps I'm in the minority here, but I find this behavior to be offensive enough that I immediately stop reading and move on. Trading user experience for analytics data is not a good trade.
wldlyinaccurate|12 years ago
How does it break the open in new tab functionality? You can detect if the user was Cmd/Ctrl-clicking, or using the middle mouse button. I've done this on many sites and it works fine.
jessaustin|12 years ago
Ugh. That's awful.
The alternative is to hijack the click event, wait for say 100ms, and then load the new page via JavaScript, but that also break the open in a new tab functionality.
Is this true? ISTM that if you just have:
Your analytics stuff still gets done, and open in new tab still works. (As written, the analytics doesn't run when opening in a new tab, but ISTM you can just capture some mouse events to work in that case as well.)chii|12 years ago
Unless your computer is too slow to handle many tabs, having more tabs is almost always better!
fahdsyed|12 years ago
SnowLprd|12 years ago
kamjam|12 years ago
I know the developer has given a very good explanation about this, and there are still others complaining...
Curious to know whether it was just the link to the Github project which irked you (and others) or links to other external sites such as W3C/Bugzilla/CanIUse/etc are considered "valid" to open in new tabs?