Closed Bug 262376 Opened 20 years ago Closed 10 years ago

mail.google.com - cmd+click opens link in new window AND a new tab (external links in Gmail messages)

Categories

(Web Compatibility :: Site Reports, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: mozilla.e4v, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.3) Gecko/20040930 Firefox/0.10
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.3) Gecko/20040930 Firefox/0.10

When you Command-click (to open in a new tab on MacOSX version) a link in a
GMail message, the link opens in a new tab and a new window. To assist
developers without GMail accounts, here is an example of the HTML code for a
link which results in this behavior (although it only seems to work when the
proper javascript is set up -- I don't know exactly how that works):

<a onclick="return top.js.OpenExtLink(window,this)" href="http://www.foo.com"
target=_blank>

Note that this behavior does not occur if you Control-click (right click) on a
link and select the option "Open Link in New Tab".

I think this bug also affects the Linux version. I have not tried the Windows
version.

Reproducible: Always
Steps to Reproduce:
1. Log in to GMail and open a message containing an external link. 
2. Command-click (or Shift-click on other OSes) to open the link in a new tab

Actual Results:  
The link opens in a new window and in a new tab in the old window.

Expected Results:  
The link would open only in a new tab.
Have you tried in a clean profile, without any extensions (particularly things
like TBE/TBP and Single Window)?
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040930
Firefox/0.10

shift+click open 2 new windows
ctrl+click opens a new window and a new tab

(No TBE/TBP/SingleWindow)
I don't think this is a bug in Firefox (But it might be).

I had the same thing happen to me. I think the problem is that GMail uses
JavaScript to open the link in a new window, and Firefox executes that
JavaScript and opens it up in a new tab.

If anyone needs a GMail account to get more info, send me an email.

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.3) Gecko/20041002
Firefox/0.10
I emailed the GMail people even before I posted this bug, with the hopes that
they might just use the target="_blank" attribute, but so far I haven't heard
anything specific back. They are apparently considering or working on a
Javascript-free version of GMail, but most of the Javascript use is agreeable.

I'm not entirely certain if Firefox is doing something wrong, or GMail is doing
something it shouldn't, but it would be nice to get this resolved somehow. Would
it be possible and acceptable to ignore Javascript commands that open new
windows on links that are going to be opened in a new tab or window anyway?

I'm not using any tab- or window-related extensions, but I'll try making a test
user with no extensions.

While this gets figured out, I would suggest that other GMail users let GMail
know they need to change something ;)
Confirmed on 10.3.8 with
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050402
Firefox/1.0+
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 297249 has been marked as a duplicate of this bug. ***
Bug 151142 exists on both Windows and Mac, so the fact that this happens on Mac
with Cmd but not on Windows with Ctrl makes me think that Google is avoiding
this problem on Windows by explicitly testing whether the Ctrl key is pressed.

This should be fixed in Firefox in bug 151142, but it should also be fixed by
Google so that Google's code is consistent across platforms and so that Gmail
works well with browsers without the fix for bug 151142 (such as Firefox 1.0 and
Firefox 1.5).
Assignee: firefox → english-us
Component: General → English US
Product: Firefox → Tech Evangelism
QA Contact: general → english-us
Summary: Opening external link from GMail in new tab also opens in new window. → gmail.google.com - cmd+click opens link in new window AND a new tab
I turned this into a tech evang bug because fixing this on the Firefox side is
already covered by bug 151142.
Summary: gmail.google.com - cmd+click opens link in new window AND a new tab → mail.google.com - cmd+click opens link in new window AND a new tab (external links in Gmail messages)
*** Bug 316364 has been marked as a duplicate of this bug. ***
*** Bug 329591 has been marked as a duplicate of this bug. ***
*** Bug 346052 has been marked as a duplicate of this bug. ***
I'm at a loss trying to understand why Safari gets it right with Gmail, and Firefox doesn't.  If Gmail was doing something improper, wouldn't Safari have the same problem?  And I get TWO TABS, not one tab and one window, because I have my Preference->Tabs set to Open in a new TAB, not a new window.  This is even more bizarre than one tab and one window.  Seems like Firefox should know it is dealing with target="_blank" and ignore the modifier key requesting a new window/tab.  On a Mac, that's the Command key.  See Bug 384924, marked as a duplicate of this.
Dick, Safari doesn't send key codes to web pages for command key presses (at least not released versions of Safari), for one, but Gmail also sends different HTML+JS code to Safari than it sends to Gecko.
Smokey, I don't recollect saying key codes were sent to web pages.  What I thought I said was that modifier keys were recognized by the browser (Safari, Firefox ,etc.) such that the mouse-over link showed different information in the Status Bar, such as "in a new window".  Safari definitely does that...change the Status Bar information based upon modifier keys.  As for Gmail sending different HTML+JS depending upon the client browser, I would believe that if supported by what I observe.  I've used "View Source"for Gmail on both Safari and Firefox, and they appear to be the same source, yet Safari deals with what I described in Comment #13 above, and Firefox doesn't.
Not sure this is still valid. Could someone re-test and maybe close it as Invalid.
Assignee: english-us → nobody
Component: English US → Desktop
I just tested on two PPC G3 machines.  
#1, 10.3.9 with FF 2.0.0.6, cmd-click opens TAB only.
#2, 10.4.11 with FF 3.5.19, cmd-click opens TAB only.
I have no other PPC platforms for testing.
Thanks Dick. :)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Fine on Intel Mac with Firefox Nightly as well.

Shift+click only opens in a new window, Cmd+click only opens in a new tab, as expected. I tried both a plain-text email and an HTML email, both displayed by Gmail.
Status: RESOLVED → VERIFIED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.