If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

control-click fails to open a new tab when javascript onClick associated with link (right click, open in new tab, works)



Tabbed Browser
14 years ago
9 years ago


(Reporter: Jason House, Assigned: jag (Peter Annema))


({qawanted, testcase})

Windows XP
qawanted, testcase

Firefox Tracking Flags

(Not tracked)




(1 attachment)



14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030718
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030718

In the page at http://www.google.com, control-clicking on the links above the
text box do not open new tabs while those on the right side do open new tabs.

Investigating more, the stuff at the top is embedded in the following HTML:

<td id=1 bgcolor=#efefef align=center width=95 nowrap onClick="return
c('www.google.com/imghp','wi',event);" style=cursor:pointer;cursor:hand;><a
id=1a class=q href="/imghp?hl=en&tab=wi&ie=UTF-8&oe=UTF-8" onClick="return
c('www.google.com/imghp','wi',event);"><font size=-1>Images</font></a></td>

I see the href in there which seems to be the "normal" link.  I do not know,
however, how the onClick stuff gets used...  

Reproducible: Always

Steps to Reproduce:
1. Set up browser to open a new tab when doing control-click
2. go to www.google.com
3. control click on "Images"

Actual Results:  
The current browser window/tab gets replaced with the linked web page (google
image search in case of example)

Expected Results:  
Open a new tab with (google image search)

Comment 1

14 years ago
Created attachment 130517 [details]
minimal html example

This is not a functionality bug.

What is happening is when the link is clicked it submits a form within the
page, which then displays the new page. I have made a simple example which does
the same thing so that it is easy to understand the mechanism. I have tried to
make the HTML/JavaScript as simple as possible.

It does stop ctrl-clicks (and therefore tab browsing) from working properly. Is
this a tech evangelism bug?

Comment 2

14 years ago
Well, the fact the right clicking and choosing open link in new tab worked on
google made me think that there was an "easy" fix ;)   I think this really boils
down to two things:

1. Cntrl-Click and Right Click->Open Link in New Tab have differing functionalities.
  The two should probably use the same code?  
     One runs the java script, the other follows the href.  
     In your example, a right click and open in new tab causes a 404 
     error since the href provided is invalid.  In the google example, 
     the href is valid and had the expected behavior.
  Should this technically be a different bug, and make bug 217262 rely
   on that bug?

2. Would the following pseudo code work in all cases?
   a. Create a new tab in the browser
   b. Associate the current page and data with the new tab
   c. Execute whatever action is required by the link
      (in terms of #1, run the java script)
   (It should work fine on the example, and on the google case,
    and on normal links)

Comment 3

14 years ago
The lack of valid href in my example makes no difference, there's only one bug
here. The issue is what functionality should ctrl-click have when there is as
onClick event associated with a hyperlink? 

There is probably an argument both ways. In the google example it would make
sense to open a new window since the javascript is a link anyway. There are
other cases where the JS might do something else (e.g. interact with another frame).

I don't know the answer, so adding keyword qawanted.
Keywords: qawanted


14 years ago
Attachment #130517 - Attachment description: Not a Bug - minimal html example → minimal html example

Comment 4

14 years ago
updated summary to include "when javascript onClick associated with"
changed severity to minor (easy workaround).
added keyword top100, testcase

Someone needs to say what the correct funtionality of the browser should be in
this case.

If the browser is doing what it should then this is still a tech evangelism bug.
Severity: normal → minor
Ever confirmed: true
Keywords: testcase, top100
Summary: control-click on certain links fails to open a new tab (right click, open in new tab, works) → control-click fails to open a new tab when javascript onClick associated with link (right click, open in new tab, works)


14 years ago
Blocks: 220500

Comment 5

14 years ago
*** Bug 229277 has been marked as a duplicate of this bug. ***

Comment 6

14 years ago
dupe of Bug 151142 ?

Comment 7

14 years ago
Google has redesigned as of 2004-03-29.  This bug doesn't happen on any of their
pages anymore -- CTRL-clicking on the sections opens in new tabs as expected.
Should remove top100.

Comment 8

14 years ago
removing top100 and google url. adding test case to the url.

Comment 9

14 years ago
Dupe of bug 138198, no?

Comment 10

14 years ago
This is definitely related to both bug 151142 and bug 55696 too. The discussions
surrounding this bug have had been had in other bugs. I am marking this as dupe
against bug 151142, but it could equally be duped against a few other bugs I think.

*** This bug has been marked as a duplicate of 151142 ***
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.