Closed Bug 343436 Opened 15 years ago Closed 15 years ago

using "onclick" (instead of HREF) disables display of linkname & middle click open


(Firefox :: General, defect)

Windows XP
Not set





(Reporter: mozilla, Unassigned)




User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060508 Firefox/
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060508 Firefox/

On the listed webpage above, they display many resellers.  If you move your mouse over one of the images, the cursor changes to a hand, indicating it is over an active link.  You can click on the link and it will take you to a "reseller" website.

Problem: no link-target address is displayed in status line & middle click won't open the link at all (wanted to open vendor links in a tab).

The links in question use an "onclick" address specification.  Instead of
<a href=target>, they use <a onclick="javascript(website)>.  I don't see a way
to display the target address, BUT, unless it is impossible, the middle click of a mouse should open the target of the "onclick" tag in a new tab.

Reproducible: Always

Steps to Reproduce:
1. Goto webaddr
2. Move cursor over a vendor; 
3. Press middle click to open link in a tab
-------alternatively here is a snip of html that shows the problem:
        a { cursor:pointer; text-decoration: underline; color= #80f0ff; }
        a:hover { cursor:pointer; }
    <script language="JavaScript" type="text/JavaScript">
        function ShowSite(site) { window.location = site; }
    <a onclick="javascript:ShowSite('');" >
        Click goes to Google. <br> Middle click nonfunctional.
            <br>No target displayed in status bar.

Actual Results:  
nothing.  tab doesn't open, link is not followed.

Expected Results:  
I expected the vendor website to open in a new tab.

I'm not sure exactly how to address this issue.  I think displaying the link
target: "javascript::ShowReseller('') in the status window would help in this case -- at the very least it indicates that some javascript action will happen on click.  

I would *like* it if middle click triggered the "onclick" target AND opened a
new tab, in which the javascript is executed & the next attempt to open a new browswer instance is trapped and opened in the tab.  The next window open event might be cancelled by any user input or other HTML tags (in which case the tab
would close and the user would ideally end up in the window they started from).

Admittedly, this could be considered an RFE, but I think the middle click
should activate an 'onclick' event -- a middle click is a type of click, no?
(analogy breaks down with rightclick, I suppose).
Component: Safe Browsing → General
QA Contact: safe.browsing → general
Whiteboard: DUPEME
Firing onclick for middle clicks is bug 156137 - WONTFIX, because doing so would break a lot of assumptions that web authors can generally make about when onclick fires. Making middle click work for javascript-triggered links is bug 55696. I don't know of any bugs about making the status bar indicate what will happen when you click a link, but any such bug would likely be dependent on bug 55696, so I'm going to mark you bug as a duplicate of that.

*** This bug has been marked as a duplicate of 55696 ***
Closed: 15 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.