Closed Bug 232172 Opened 21 years ago Closed 21 years ago

Make link modifiers work on the home button

Categories

(Firefox :: Toolbars and Customization, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox1.0beta

People

(Reporter: steffen.wilberg, Assigned: steffen.wilberg)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 4 obsolete files)

I'd like the home button to behave somewhat like a bookmark on the bookmarks toolbar: It should open a new tab (or several, if you have multiple homepages) upon middle-clicking or ctrl-left-clicking.
To be complete and consistent, shift-left-click that button should open a new window just like ctrl-n does.
Summary: add middle-click and ctrl-left-click action to the home button → add middle-click, ctrl-left-click and shift-left-click action to the home button
Attached patch patch (obsolete) (deleted) — Splinter Review
Use the new function BrowserHomeClick to take care of mouseclicks. I also simplified the loadOneOrMoreURIs function: It's not necessary to check if there are multiple homepages. The code used for those works fine for single homepages as well. loadOneOrMoreURIs is called from BrowserHomeClick in case of simple left-clicks. Upon shift-left-clicks, OpenBrowserWindow() is called, that's just like pressing ctrl-n. Upon middle-clicks or ctrl-left-clicks, BrowserHomeClick uses code that is derived from loadOneOrMoreURIs. It adds a new tab for your homepage, or multiple tabs if you have more than one. I don't think it's worth respecting "browser.tabs.opentabfor.middleclick". It's set to true by default on all platforms and I can't imagine anyone setting that to false. Do Macs use different buttons?
Comment on attachment 139891 [details] [diff] [review] patch >+ if (aEvent.button == 1 || (aEvent.button == 0 && aEvent.ctrlKey)) { // middle-click or left-click and ctrl I'll replace "left-click and ctrl" with "ctrl-left-click" in the next revision.
Comment on attachment 139891 [details] [diff] [review] patch Pierre, what do you think?
Attachment #139891 - Flags: review?(p_ch)
This is a dup of bug 197304.
*** Bug 197304 has been marked as a duplicate of this bug. ***
Wouldn't it be possible to reuse/refactor the code that loads what's in the urlbar?
Pierre, I don't think so. When you submit an url in the urlbar by hitting enter or clicking the go-button, handleURLBarCommand is called, which calls canonizeUrl and BrowserLoadURL, all in browser.js. These functions don't support opening multiple pages at once, which is what we need for multiple homepages. And BrowserLoadURL only checks for alt-enter to open a new tab. But we need middle-click and ctrl-left-click here. I thought about bookmarks code, but bookmarks don't support multiple pages either. And we don't need that support in bookmarks, do we?
Status: NEW → ASSIGNED
Target Milestone: --- → Firefox0.9
Comment on attachment 139891 [details] [diff] [review] patch Blake, what do you think?
Attachment #139891 - Flags: review?(p_ch) → review?(firefox)
My only problem with this is that it introduces a rather large UI inconsistency. The Home button would support Middle click/shift click, ect, but the other navigation toolbar buttons would not. I personally think that if open in new tab/new window functions are going to be added to Navbar buttons, it should be done to all of them (like MozFBRH does) or none of them (left to extensions).
I am in agreement with Comment 10, though if the devs agree I think we should either change the summary of this bug to cover all navigation bar items, or create a new bug to cover buttons other than the home button. What do people suggest?
I think this behaviour would be fantastic for all the buttons -- and also the back/forward drop-downs. I've used MozFBRH extension and think this is exactly the sort of tiny improvement that the base browser should have, every user should benefit! (In particular, Shift+left-click refresh acts like Ctrl+N in IE, forking your browser session from the current page). One thing to note, is that Ctrl+click refresh already means "force reload" -- (have to use Shift+Ctrl+click instead?)
I am in full agreement with comment 12 and would like to add that the throbber (which links to the firefox site) should have this function as well.
I can implement this for other buttons as well, but I'd like to a word from a dev first that this would be acceptable (not wontfix). My patch for the home button is already 2 months old.
The throbber is no navigational toolbar item (even though it links to the firefox page by default). It is a branding item, which also shows loading activity. Do not add middle-click, ctrl-left-click and shift-left-click action to the throbber.
*** Bug 239437 has been marked as a duplicate of this bug. ***
*** Bug 240624 has been marked as a duplicate of this bug. ***
Attached patch patch v1.1 (obsolete) (deleted) — Splinter Review
The comment change I promised in comment 3.
Attachment #139891 - Attachment is obsolete: true
Attachment #139891 - Flags: review?(firefox)
Comment on attachment 149227 [details] [diff] [review] patch v1.1 Ben, this makes the home button behave like a bookmark on the bookmarks toolbar. Also works for multiple homepages. It doesn't change anything visual, it just makes the button more powerful. Explanation is in comment 2.
Attachment #149227 - Flags: review?(bugs)
Bug 198028 is requesting similar functionality for Go button.
Target Milestone: Firefox0.9 → Firefox1.0beta
Comment on attachment 149227 [details] [diff] [review] patch v1.1 I want to make use of the functions Jesse proposed in his patch for bug 246719. -> Removing review request.
Attachment #149227 - Flags: review?(bugs)
Adding dependency to bug 246719 therefore.
Depends on: 246719
Attached patch patch v1.2 - use new functions (obsolete) (deleted) — Splinter Review
This patch uses whereToOpenLink() and mimics openUILinkIn(), introduced by Jesse in bug bug 246719. All the link modifiers work for single and multiple homepages. I limited saving to the first homepage though.
Attachment #149227 - Attachment is obsolete: true
Summary: add middle-click, ctrl-left-click and shift-left-click action to the home button → Make link modifiers work on the home button
Attachment #151941 - Flags: review?(bryner)
Attachment #151941 - Flags: review?(bryner) → review+
I hate these js strict warnings, so I shouldn't introduce another.
Attachment #152655 - Attachment description: fix js warning: redeclaration of urls → patch v1.3 - fix js warning: redeclaration of var urls
Attached patch patch v1.4: fix oops (deleted) — Splinter Review
Attachment #151941 - Attachment is obsolete: true
Attachment #152655 - Attachment is obsolete: true
Trunk checkin: 2004-07-16 09:32 Branch checkin: 2004-07-16 09:39 Fixed!
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 262432 has been marked as a duplicate of this bug. ***
QA Contact: bugzilla → toolbars
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: