Closed Bug 111909 Opened 23 years ago Closed 21 years ago

middle-click on mailto: link opens a blank tab

Categories

(SeaMonkey :: Tabbed Browser, defect)

x86
Windows NT
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 97032
mozilla1.1alpha

People

(Reporter: aha, Assigned: jag+mozilla)

References

(Depends on 1 open bug)

Details

Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.6+) Gecko/2001112508

Repro:
1. set 'Middle click or control-click of links in a Web page' to checked
2. fine page with link mailto:foo@foo.com
3. middle click on it

Actual:
New tab is opened, mail client is starting.
Expected:
Just mail client will be started, because tab with mailto: is IMHO useless.
if tab is not opening, a new window will open on a Mailto: link.
We block new window creation in this case (just open mailcompose, not
mailcompose _and_ new window).  We should also block new tab creation.
Status: UNCONFIRMED → NEW
Ever confirmed: true
All middle mouse clicks on mailto: links can be disabled by this, small, change
in contentAreaClicks.js:

143 - handleLinkClick(event, linkNode.href);
143 + handleLinkClick(event, linkNode.href.toLowerCase);
195 + if ( href.search( "mailto:" ) >= 0 ) { // bail out on mailto links
196 +   return;

-Neil.
Oops, line 196 should read

return false;

to prevent a JS strict error.
Well, you better forget about line 143, because a middle mouse click on 'View
Bugs Already Reported Today' on bugzilla.mozilla.org results in this message:

Please stand by ...
Content-type: text/html
Software error:
Evil code attempted to write stuff to the shadow database. at globals.pl line 201.

For help, please send mail to the webmaster (webmaster@mozilla.org), giving this
error message and the time and date of the error.

-Neil.
Neil:

      if (href.toLowerCase().search( "mailto:" ) == 0) // bail out on mailto links
        return false;

or more simple (if otherwise returning true):
      return (href.toLowerCase().search( "mailto:" ) == 0);

1.) You don't want to change the url. Only lowercase it, while comparing.
2.) Compare with == not >=. The URL might contain "mailto:" somewhere else.

Hope this helps,
  Niklas
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1
Reassigning to new component owner.
Assignee: hyatt → jaggernaut
Status: ASSIGNED → NEW
*** Bug 122329 has been marked as a duplicate of this bug. ***
I do get the same behaviour for other protocols as well on my mac using
<command-click>.

(Sorry for the spam, just wanted to add myself to the cc list. )
Summary: could open mailto: link to a new tab using middle button → middle-click on mailto: link opens a blank tab
QA Contact: sairuh → pmac
*** Bug 179833 has been marked as a duplicate of this bug. ***
Depends on: 97032

*** This bug has been marked as a duplicate of 97032 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.