Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use an extension to remap Firefox keyboard shortcuts Web Browsers
I'm really trying to switch over to using Firefox as my default browser. But it's the little things that keep me from going over. For instance, my hands hardly ever leave the keyboard. And I love being able to do web searches in Safari using the hotkey, Command-Option-F. I realize that it's possible to put the focus in the upper-right web search field using Command-K in Firefox, but it's sometimes difficult to remap my brain.

If you want to change your hotkeys, consider using Dorando's keyconfig extension -- here's some more info on the extension. Be sure to read the first post (by Dorando) in that link very carefully, and consider clicking on the 'Example custom keys' link as well -- it's right above the Changes: section of the first post. It's an awesome wealth of possible keys.

For example, I added a new key called 'Next tab,' and pasted in this code:
 gBrowser.mTabContainer.advanceSelectedTab(1);
I then assigned the Command-Shift-Right Arrow hotkey to it. Then, of course, I added a 'Previous Tab' key by changing the 1 to a -1, and assigned it to Command-Shift-Left Arrow. Hope this is helpful for all your Firefox key mapping needs! BTW, I am grateful to the Firefox user community for providing such excellent online support and even live support via IRC.

[robg adds: At least in the case of Web Search, you can also reassign the shortcut key using the Keyboard & Mouse System Preferences panel. Make sure Firefox isn't running, and thn hit the Plus sign in the Keyboard Shortcuts tab, find Firefox using the 'Other...' option, and then enter Web Search as the command to be assigned. Enter your desired shortcut (Command-Option-F), and then click OK. Next time you launch Firefox, you'll have your Safari-like web search shortcut. This won't work for Previous and Next Tab, though, as those shortcuts do not have corresponding entries in the menus (at least not that I can find).]
    •    
  • Currently 2.29 / 5
  You rated: 1 / 5 (7 votes cast)
 
[28,027 views]  

Use an extension to remap Firefox keyboard shortcuts | 23 comments | Create New Account
Click here to return to the 'Use an extension to remap Firefox keyboard shortcuts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use an extension to remap Firefox keyboard shortcuts
Authored by: yergnov on Jan 17, '06 07:21:42AM

On the same line- is there an easy way to put the focus on the URL bar? In IE *cringe* it was always easy to just hit a TAB and highlight the URL and begin typing a new address- HOW is this done in Safari/ Firefox?



[ Reply to This | # ]
Use an extension to remap Firefox keyboard shortcuts
Authored by: fds on Jan 17, '06 07:30:38AM

Command-L



[ Reply to This | # ]
Autofill in URL field
Authored by: vkeesari on Jan 17, '06 09:02:02AM

This is probably for the forums, but can Firefox search through your bookmarks and autofill in the url, like Safari? I can't find an extension for this, and it's a feature I really miss.



[ Reply to This | # ]
Autofill in URL field
Authored by: ehershey on Jan 18, '06 06:15:21PM

This isn't quite what you're asking for, but one thing I use a lot for quick access to bookmarks is the keyword field. You can set a keyword, say "webmail" on your bookmark for http://webmail.employer.com/. Then all you have to do is type the keyword into your address bar and it will take you to the bookmark.


You can also use http://keyword.ernie.org/ to keep a centralized keyword store and set your keyword.url config entry to that URL. But the keyword field in local bookmarks will work in a single browser.



[ Reply to This | # ]
Firefox 1.5
Authored by: john1620b on Jan 17, '06 08:04:10AM

Firefox 1.5 added a couple of useful keyboard shortcuts, such as Command-Option-Right Arrow for next tab and Delete (or Backspace) to go back in your history. Myself, I use Butler to remap keyboard shortcuts -- that way, if I update Firefox and the extension is incompatible, my shortcuts still work.



[ Reply to This | # ]
Firefox 1.5
Authored by: genericuser on Jan 17, '06 08:17:09AM

you can access most option and keyboard shortcuts in firefox by going to <tt>about:config</tt>



[ Reply to This | # ]
An addendum to my post
Authored by: Thom on Jan 17, '06 08:40:32AM

Having spent a few days now with FireFox, there are only a few things that are still causing me grief. One of them involves the behavior of cursors inside of textfields, both in forms and in the location/search bars. The up/down arrow keys should position the cursor at the beginning / end of a field, and they don't seem to. However, it appears there is already a bug fix in the works about this.

Also:
gBrowser.mTabContainer.advanceSelectedTab(1,true);

Notice the second argument, 'true' in the advanceSelectedTab method. This will automatically rotate back around to the beginning if you're on the last tab. Similarly,
gBrowser.mTabContainer.advanceSelectedTab(-1,true);
...will highlight the last tab if you hit your 'Previous Tab' command from the first tab.

I spent a bunch of time researching and programming a javascript workaround before someone pointed out that the command took the second argument. Still, it was a neat look into the firefox internals.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: CptNerd on Jan 17, '06 09:59:24AM

One thing I noticed when I went to Firefox 1.5, the Page Up/Page Down keys no longer work. They worked fine in 1.1 but something happened to disable them in 1.5. Has anyone else experienced this, or is it a local preferences file issue? I didn't see anything in the about:config page, and I'm reluctant to throw away all my preferences. I never saw anything about this problem on the Firefox discussion boards.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: Elliot Shank on Jan 17, '06 12:21:43PM

In what circumstances don't they work?

I don't have any problems with them with the following exceptions:

1) If the focus is in a form widget, then movement keys only work within that widget. I usually run into this when there's a dropdown on a page and I just want to check out what the options are and not actually use that dropdown (common in sites like Ars Technica that use them for page navigation). After displaying the list, the focus is on that widget and not the page, so things like Page Up and Page Down are attempting to manipulate the widget and not the page as a whole.

2) If there is a plugin on a page and you've somehow interacted with that plugin. For me, this mostly happens when the subject of the page is a Flash application. The plugin gains control of the keyboard. So, when I'm done with the Flash thing, I attempt command-W and the window doesn't close.

3) Another focus related thing: what's called the "chrome". The chrome is everything you see in the browser that isn't part of the page itself, i.e. the toolbars, status bar, the location/address/URL field, the title bar, etc. If any of these have focus, then things like Page Up and Down and the arrow keys won't affect the page itself.

A related thing is that Apple's two-finger scrolling won't work on the forground window, unless the cursor is above the page itself. Since I often move the cursor off to the side and the cursor disappears when you start using the keyboard to type in fields like this, I can't see where the cursor is and get frustrated when the scrolling won't work like I expect it to.

3) Frames. There are more pages that contain frames than you expect. Some sites are getting really clever at hiding the fact that they're using them. And if focus isn't on the one that you're interested in, standard keyboard navigation isn't going to help you get anywhere.

I'd be interested in hearing of any other circumstances that you run into with this sort of problem.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: CptNerd on Jan 17, '06 10:16:21PM

I open the same page with Firefox 1.1 and then with 1.5. When I run 1.1 I can click once inside any element with a scrollbar, and can use either space or Page down to scroll one page. When I open the same page in 1.5, even if I select text or an image in the element, I can't page up or down, either with the space key or with Page Up or Page Down.

I don't have a problem with Camino or Safari, only Firefox, which makes me think it's some kind of Firefox-specific configuration.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: simbalala on Jan 17, '06 01:32:43PM

Page Up and Page Down work just fine for me. it's Function (fn) and the appropriate arrow key.

Also: Spacebar = Page Down and Shift Spacebar = Page Up. IE always worked like this.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: CptNerd on Jan 17, '06 10:23:31PM

It doesn't work for me, which is the problem. I have the same behavior on my iMac and my Powerbook, but only with Firefox 1.5. Safari and Camino both behave as expected, but there's some configuration problem with Firefox on my computers, either a preferences file or some other kind of config file. No matter what I do, no matter where I select or click, page up and page down from the keyboard don't work.

I tried looking for a Firefox preferences file in my ~/Library/Preferences directory, but found nothing. I don't want to have to blow away all my settings and re-install, but it looks like I might have to.




[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: beej69 on Jan 30, '06 01:18:38PM

there is a bug tracking this:
https://bugzilla.mozilla.org/show_bug.cgi?id=175620



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: mudbug on Feb 14, '06 07:20:41AM

Something interesting:

I have the same problem, the "page up" and "page down" keys do not work in FireFox 1.5.0.1. Clean install of 10.4.4 so no other factors at work here.

Thru reading this thread and playing, I found that if I hold down the space bar, then the "page up" and "page down" keys work! I don't prefer this method but it's better than that awkward shift/spacebar combo.

I would love for the keys to work as they're supposed to.



[ Reply to This | # ]
Page Up/Page Down keys?
Authored by: linhusa on Mar 19, '06 01:55:57AM

I found a possible fix for "page up/page down" keys not working.
You will need to turn off caret browsing in firefox by either:
1. toggle it with F7
2. goto Firefox > Preferences > Advanced > General Tab > "uncheck" the "allow text to be selected with the keyboard" option



[ Reply to This | # ]
There's no need for extensions and get rid of the space-wasting search box entirely
Authored by: Elliot Shank on Jan 17, '06 11:53:48AM

First off, all the major browsers on all the major platforms support using command/ctrl-L to get into the address/URL bar.

Next, Firefox supports searching from the URL bar, so you should customize the toolbar to lose the search box so that you can see more of the URL of the site you are visiting.

Firefox bookmarks have a property called "keyword" which allows you to easily perform searches based upon those bookmarks. Firefox comes with several of these already set up; open up the Bookmarks Manager and look in the Quick Searches folder.

The way that you use one of these is to go into the URL field and type "<keyword> <search terms>" and hit enter. One of the default bookmarks is a dictionary lookup with a keyword of "d"; an example of using this bookmark is "d quaquaversal" (yes, that's a real word). To look at the article on everyone's favorite stimulant in Wikipedia, type "wp caffeine". The search terms should be exactly as you would type them in the text box on the search site, including quotes. So, to look up appearances of a certain band in the best city in the world on Google, you would enter 'g "they might be giants" chicago'.

Now Firefox ships with only a few of these things set up already and it's missing the one that you use the most; how do you rectify this situation? It's easy! Just Ctrl/right click on the text field for the search function on the website, and select "Add a Keyword for this Search...".

So, to make it easy to search this site from whereever you are on the web, right click on that search box in the upper right hand corner of this page, select the add keyword item from the menu, and in the dialog that shows up, put "Mac OS X Hints" in the name field and "mh" in the keyword field. Then, whereever you are and whenever you want to find hints for applying mass changes to an image, just hit command-L, type "mh photoshop filter", and hit enter. Presto!.

I've set up my own bookmarks for things like Amazon, All Music Guide, and a bunch of the Google specialized searches.

The way that these things work is that, if Firefox looks at what you've typed into the URL box and it contains a space and the first sequence of characters before the first space matches the keyword for one of your bookmarks, it takes the URL in the bookmark and substitutes the rest of what you typed for any "%s" in that URL before actually using the URL.

For example, if you look at the bookmark created in the above example for this site, you will see that the URL is "http://www.macosxhints.com/search.php?query=%s&type=stories&mode=search&keyType=all". If you type "mh idvd" in the address bar, Firefox will try to navigate to "http://www.macosxhints.com/search.php?query=idvd&type=stories&mode=search&keyType=all", giving you all the hints for iDVD.

You can get really sophisticated by hand editing the URL, making sure to put the "%s" in the right place.

I wanted an easy way to find things near where I work using Google Local. If you use Google Local, you will notice that there are two search fields, one for what you're looking for and another for where you want to find it. So, starting with a bookmark created via the "add keyword" menu item, I played around with the URLs that Google Local produces and created a "gw" keyword ("Google Work") with a URL of "http://local.google.com/local?q=%s&num=20&svnum=100&hl=en&lr=&near=60603&sc=1&rl=1". If you look at the parameters in this URL, you will see the usual "q=blah" part of every Google facility for the search terms. The interesting part is the "near" parameter, which I specified as the ZIP code of my office.

If you fiddle with this sort of thing, make sure that you URL encode any special characters; if you don't know how to do this, do some Google Local searches using the text for the location that you want and just copy out the value of the "near" parameter from the resulting URL (up to the end of the URL or the next ampersand).

Using keywords makes my life so much easier.

(And I hate that, in Safari, the URL field is tied to the search field, so you can't get the search field out of the toolbar.)



[ Reply to This | # ]
Very cool
Authored by: simbalala on Jan 17, '06 01:20:09PM

Good tip(s).

This is one of those things that we'd all know already if we read the documentation. I never used the search box in the browser bar anyway. I have a shortcut key for a Google bookmark so it was Command T (for new tab) then Control g for Google.

The Keywords are even better.



[ Reply to This | # ]
There's no need for extensions and get rid of the space-wasting search box entirely
Authored by: neuralstatic on Jan 17, '06 01:35:25PM

the multiple search engines is so valuable to me, i'd never be able to lose that search box. saves me way too much time



[ Reply to This | # ]
multiple search engines is so valuable to me
Authored by: simbalala on Jan 17, '06 09:23:29PM

Really?

Set up some of the Keywords with a character or two for each search engine and your "multiple search engines" world will suddenly become much, much larger (and quicker).



[ Reply to This | # ]
There's no need for extensions and get rid of the space-wasting search box entirely
Authored by: Elliot Shank on Jan 18, '06 08:48:58AM

You want multiple search engines?

Set up bookmarks with the following (suggested) keywords and URLs:

y: http://search.yahoo.com/search?p=%s
aj: http://web.ask.com/web?q=%s
atw: http://www.alltheweb.com/search?q=%s
teo: http://s.teoma.com/search?q=%s
msn: http://search.msn.com/results.aspx?q=%s
l: http://search.lycos.com/default.asp?query=%s
tech: http://www.technorati.com/cosmos/search.html?url=%s
f: http://www.feedster.com/search.php?q=%s
b: http://www.bloglines.com/search?t=1&q=%s
alt: http://www.altavista.com/web/results?q=%s

So, those are a bunch of basic things... how 'bout these:

Search Amazon, but only in the Tools & Hardware department: http://www.amazon.com/gp/search/?search-alias=tools&keywords=%s

Search Download.com, restricted to things associated with download managers: http://www.download.com/3120-20_4-0.html?tag=srch&qt=%s&tg=dl-2071

To look up a UPS package's progress, without having to navigate through the site and click the stupid checkbox, etc.: http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=%s&track.x=0&track.y=0

(Yes, this is done more easiliy with the UPS/FedEx Tracking Linkify Greasemonkey script, but it's a good example)


The point is that you can access more search engines more quickly, without having to wait for someone to come up with a new search engine plugin. A new search engine can be added with one context menu click and filling in two text boxes. Not only that, but as you can see above, you can customize how those searches work.



[ Reply to This | # ]
[OT] Timely, almost
Authored by: n8gray on Jan 17, '06 03:44:49PM

This is bloody hilarious. After using FF as my main browser for the last few weeks I finally decided to figure out how to bind next/prev tab to something I like. I spent an hour with a friend digging through .xul files and searching the web, eventually finding the keyconfig extension. We hacked together some javascript and debugged until it was working. I thanked him, restarted FF, and browsed to my favorite OS X hints site. What's the first hint? This one.

I often tell my wife that the universe revolves around me, but for some reason she has doubts that this is so. This is a nice bit of evidence for my case, apart from the inconvenient temporal flaw that I didn't see the site *before* spending an hour solving the problem. Still, your javascript one-liner is much better than my 10-liner, so I can't fault the universe *too* much. After all, it can't be easy to bend all those dimensions to my convenience; I'm prepared to forgive a minor causality error every now and then.

In all seriosity, thanks for the hint!



[ Reply to This | # ]
Hey, don't blame me...
Authored by: Thom on Jan 17, '06 04:31:00PM

...I voted for Kodos! Er, wait, nevermind.

Did the version you came up with, look something like what I posted over here?

// previous tab, cycle to last one if at beginning
if(gBrowser.mCurrentTab.previousSibling)
{
gBrowser.mTabContainer.advanceSelectedTab(-1);
}
else
{
// call method to go to tab:
gBrowser.mTabContainer.selectedIndex = gBrowser.mTabContainer.childNodes.length-1;
}

I also spent a lot of time poring through the technical documentation for firefox, exploring in the DOM inspector, and so forth, and that's what I came up with. Then I posted it to the mozillazine and Dorando, the author of keyconfig, pointed out the second argument to the method. Heh.



[ Reply to This | # ]
Hey, don't blame me...
Authored by: n8gray on Jan 18, '06 02:11:30PM
Did the version you came up with, look something like what I posted over here?

No, it was much worse. I wish I still had it around so I could post it for your amusement. I didn't know about the advanceSelectedTab method so I was first manually walking the array of tabs to find one that was == to the current tab, then changing focus to tab (i+1)%length. I don't know jack about javascript or Firefox, so I was pretty happy to have made it that far!

[ Reply to This | # ]