Closed Bug 336925 Opened 19 years ago Closed 19 years ago

Middle Click Search Button should open new tab

Categories

(Firefox :: Search, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2 beta1

People

(Reporter: melinda.mcbeath, Assigned: pamg.bugs)

References

Details

(Keywords: fixed1.8.1, Whiteboard: [swag: 0d])

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060506 BonEcho/2.0a1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060506 BonEcho/2.0a1 The new search button should open a new tab when middle clicked, like other toolbar buttons. currently it only selects the text when middle click, like left clicking the favicon. Reproducible: Always
Most probably, that's how it should work. Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This could be implemented the same way the main navigation toolbuttons (back forward) line 1082 of browser.xul has the definition of back button line 1086 has the attribute - onclick="checkForMiddleClick(this, event);" this function is defined in utilityOverlay.js on line 207 i don't have a great understanding of xbl. but search.xml doesn't define a oncommand attribute for the search-go-button. So the function above wouldn't work. requesting blocking firefox 2.0
Flags: blocking-firefox2?
This would be pretty useful, and trivial enough to implement that we should just do it. (There's a bug somewhere on the Go button not doing this, if someone can find/file that I'll get that on radar too, since we'll be mucking with Go as well)
Assignee: nobody → pamg.bugs
Severity: normal → enhancement
Flags: blocking-firefox2? → blocking-firefox2+
Target Milestone: --- → Firefox 2 beta1
I am voting for this bug.
Blocks: 335435
[about:config] set "browser.search.openintab" to true you can open search results in a new tab by click Enter/search button.
(In reply to comment #5) Yes, or by alt-clicking without setting that option. Adding a middle-click still seems worthwhile, though.
(In reply to comment #5) > [about:config] > set "browser.search.openintab" to true > > you can open search results in a new tab by click Enter/search button. > this bug is about consistency in the ui of firefox, not whether there is a setting to change the behavior. control-click - the back button - the home button - an item on your personal toolbar what happens? now control-click the search button. What happens? alt-click - the back button - the home button - an item on your personal toolbar what happens? now alt-click the search button. What happens? middle-click - the back button - the home button - an item on your personal toolbar what happens? now middle-click on the search button. What happens? I feel like I'm watching sesame street, which one of these doesn't belong?
(In reply to comment #3) >(There's a bug somewhere on the Go button not doing this, if > someone can find/file that I'll get that on radar too, since we'll be mucking > with Go as well) Bug 279687
In addition, the browser.search.openintab pref still makes searches default to opening in a new tab, and alt-clicking still reverses the sense of that pref for a particular click. But all of that is overridden for a middle-click.
Attachment #222066 - Flags: ui-review?(mconnor)
Attachment #222066 - Flags: review?(gavin.sharp)
Attachment #222066 - Flags: ui-review?(mconnor) → superreview?(mconnor)
Comment on attachment 222066 [details] [diff] [review] Middle-clicking Search opens results in new tab >Index: components/search/content/search.xml >- var newTab = textBox._prefBranch.getBoolPref("browser.search.openintab"); >- this.doSearch(textValue, ((aEvent && aEvent.altKey) ^ newTab)); >+ // Always open in a new tab on a middle-click; otherwise examine the >+ // preference and the alt key. >+ var newTab = (aEvent && (aEvent.button == 1)); >+ if (! newTab) { >+ var newTabPref = textBox._prefBranch.getBoolPref("browser.search.openintab"); >+ newTab = ((aEvent && aEvent.altKey) ^ newTabPref); >+ } I think we should remove the aEvent null checks. I added it in bug 306358 because extensions were calling onTextEntered without an event param, but I don't think it's a good idea to continue supporting that, especially since the method has been renamed and is "private". People who want to piggy back on the search bar code like that can just call searchBar.doSearch(searchBar.value, useNewTab). nit: no space after "!".
(In reply to comment #10) > I think we should remove the aEvent null checks. > nit: no space after "!". Done.
Attachment #222066 - Attachment is obsolete: true
Attachment #222504 - Flags: review?(gavin.sharp)
Attachment #222066 - Flags: superreview?(mconnor)
Attachment #222066 - Flags: review?(gavin.sharp)
Comment on attachment 222504 [details] [diff] [review] Patch addressing Gavin's comments r=me, but please do get review from a browser peer.
Attachment #222504 - Flags: review?(gavin.sharp) → review+
Attachment #222504 - Flags: superreview?(mconnor)
Attachment #222504 - Flags: superreview?(mconnor) → superreview?(bryner)
Whiteboard: [swag: 0d]
Attachment #222504 - Attachment is obsolete: true
Attachment #223863 - Flags: superreview?(bryner)
Attachment #222504 - Flags: superreview?(bryner)
Attachment #223863 - Flags: superreview?(bryner) → superreview+
Checked in on trunk and 1.8 branch.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: