And the best thing I discovered today isn't even the new firefox -- it was the FireGestures extension, which I think has been around for a while. This extension is seriously cool!FireGestures works very straightforwardly. When you hold the right mouse button down it keeps track of which direction you move the mouse. For instance, when you draw a counter-clockwise circle it records that you moved the mouse left down right up left, or LDRUL, and when you release the mouse button it executes the associated action. In the case of LDRUL it opens the FireGestures configuration dialog. There is a bunch of predefined gestures: L goes back, R goes forward, LR opens a new tab and DR closes the current tab. I like the DR gesture because it draws an upper case L, and l is the first letter in the Danish word for "close".
The best thing about FireGestures though is that you can add your own gestures with a custom sequence of mouse moves and an action implemented in JavaScript.
The code for custom gestures have access to information about the page, for instance the DOM node on which the gesture started and the text currently selected.I've used this to add a custom gesture that triggers when you draw a W (or DRUDRU) and searches wikipedia for the currently selected text, or if no text is selected goes to the wikipedia front page:
Pretty easy -- just a few straightforward lines -- but really useful. Another gesture I've added shows the bug tracker page for the selected bug number in a new tab when I draw a 'b' (or DURDL):var text = FireGestures.getSelectedText();
if (text) {
var encoded = encodeURI(text);
var root = "http://en.wikipedia.org/wiki/Special:Search?search=";
gBrowser.loadURI(root + encoded);
} else {
gBrowser.loadURI("http://www.wikipedia.org");
}
(I've replaced the URL to our internal bug tracking system with firefox').var text = FireGestures.getSelectedText();
if (text) {
var root = "https://bugzilla.mozilla.org/show_bug.cgi?id=";
var encoded = encodeURI(text);
gBrowser.selectedTab = gBrowser.loadOneTab(root + encoded);
}
This is a great extension -- simple, straightforward and extensible.

0 comments:
Post a Comment