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

new tabs created with Ctrl-T should give focus to the location bar like Ctrl-N

VERIFIED FIXED in mozilla1.0


Tabbed Browser
16 years ago
9 years ago


(Reporter: Mike Schuette, Assigned: David Hyatt)


(Blocks: 1 bug)

Windows 98

Firefox Tracking Flags

(Not tracked)



(5 attachments)



16 years ago

Summary says it all.


16 years ago
Blocks: 55416

Comment 1

16 years ago
See also bug 37638, Ctrl+N shouldn't focus location bar in the new window.

Comment 2

16 years ago
This would be nice, as the first thing I'm going to do after opening a new tab
is to type in a URL to go to.

Comment 3

16 years ago
In response to the reference to 37638 -

To make the browser understand the difference between "about:blank"/"" and a
real page (and thus give focus to the appropriate element) would require much
more code, and I believe that this is covered by / could be snowballed into
37638 (or be put into a new bug.)
However, it'd be very simple for a new tab to just give focus to the location
bar for consistency with New Window until someone works up a fix for 37638, and
that's what this bug was filed for.

Comment 4

16 years ago
Created attachment 52210 [details]
Proposed patch ... my very first to mozilla, so please don't use sharp objects, I'm a bleeder :)

Comment 5

16 years ago
My patch satisfies me, the reporter, in that it behaves as I would have expected
a fix for this to ... whether or not the code is viable is a whole different
story :) ... (just copy/pasted the code from Startup to BrowserOpenTab)

Context|Open In New Tab gives focus to the content area, and Accel-T gives focus
to the location bar, just like Accel-N/Open In New Window.

Comment 6

16 years ago
For tabs you don't need all the complicated setTimeout stuff.  You can just set
focus right to the URL bar.

Comment 7

16 years ago
Created attachment 52262 [details]
patch v2 (took out the setTimeout stuff)

Comment 8

16 years ago
Created attachment 52265 [details]
same as v2 but with better comments

Comment 9

16 years ago
Comment on attachment 52265 [details]
same as v2 but with better comments

Looks fine to me.

Attachment #52265 - Flags: review+

Comment 10

16 years ago
It's even easier than that.  You literally need only this line.


Comment 11

16 years ago
Created attachment 52270 [details]
hyatt tells me how to write em, I just do what he says

Comment 12

16 years ago
I'm warning you, no sharp objects ... you'll be sorry ... :)

Comment 13

16 years ago
Comment on attachment 52270 [details]
hyatt tells me how to write em, I just do what he says

this looks even better ;)

Attachment #52270 - Flags: review+

Comment 14

16 years ago
adding approval keyword
Keywords: approval


16 years ago
Target Milestone: --- → mozilla1.0
so BrowserOpenTab never gets called in any situation where the user may prefer 
the content area to take focus?


Comment 16

16 years ago
Created attachment 52485 [details] [diff] [review]
Need to do the focus on a timeout.

Comment 17

16 years ago
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 18

16 years ago
buildt with the patch on linux:
URL-bar in tabs opened with ctrl+t display about:blank and do not have focus.

Comment 19

16 years ago
Oops.. This works just fine, one build later. Patch was in the first time, but i
didn't clobber. Guess something didn't build right.

Comment 20

16 years ago
Actually it's not like Ctrl-N now, because when you use Ctrl-N the location bar
not only gets focus, but URL in location bar is selected (so you can start
typing new URL).

Or should I file another bug on this ? 

Comment 21

16 years ago

Yes, if you're seeing that behavior, I'd file a different bug and just reference
this one in a comment.

Also, make sure to report your platform and build, because I can't reproduce
this error on win32.  (The location in the url bar properly gets selected, so
you can type immediately.)

Comment 22

16 years ago
pkures: garretta@garretta.com beat you too it.  Bug 104478 covers the fact that 
Ctrl+T doesn't select the location bar contents when it focuses the location 
QA Contact: blakeross → sairuh
imo, accel+N shouldn't focus the urlbar [referred to in comment 1], unless
about:blank is loaded. since that's the case with accel+T, however, i'll mark
this vrfy'd [tested with 2001.11.28.0x-comm bits on linux rh7.2, mac 10.1.1 and
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.