[userChrome.js] Mouse Gestures

I like mouse gestures, but All-in-One Gestures and Optimoz Mouse Gestures both have too much unwanted features for me. I tried to reduce unwanted parts from AiOG but I gave up since the original source codes was very complex.
And so, I made it by myself from scratch as a small user script for userChrome.js extension, which has only less than 200 lines.

xuldev.org :: userChrome.js scripts » Mouse Gestures

Major features

  1. No mouse trails. Because it would be one of a factor to be slow down the gesture. Nonetheless we can implement it by picking ‘trails.js’ from AiOG.
  2. As much as possible, it executes the ‘built-in’ commands of Firefox itself when we perform actions by gestures.
  3. No options dialog. But we can economically and flexibly customize by editing the script directly. For more details, please see ‘_performAction’ method in the script below.


11 Comments to “[userChrome.js] Mouse Gestures”


Fantastic!! I was a HUGE AIOG fan, and used the “back, forward” DesertFox script until I saw this tonight. This is excellent, and elminates a custom button as well!

Fantastic work . . . I looked at AIOG “.js” and couldn’t figure it out at all! This is a GREAT achievement – thank you and also the person that posted on the Mozillazine user.js thread, by name of “norix.” Thank again to you both!!

[…] The latest takes the cake though — gestures via a 200 line .js that can be added to user chrome and hand hacked to customize — we don’t need no stinkin pref panel! (though Mom might). […]

hi, this is very great!
There is an Gesture at “mouse gestures” for opening some links with ONE gesture. You have do drive over all links with holding the right mouse-key and to open the links you have to end this gesture with e.g. RUL. I hope you understand, my english is bad. It would be great, if you find a way to import this gesture here. I think you only need the javascript-code for that.


What about extending this by adding rocker gestures? There’s already one script for this, but it doesn’t always prevent the context menu from appearing when using the gestures.

Two enhancement suggestions which would make this implementation slightly more “Mouse Gestures”-like: http://pastebin.mozilla.org/102504 moves to a more compact customization format which allows to display the name of the gesture in the status bar; and http://pastebin.mozilla.org/102505 allows to open several links in one gesture (what Mic asked for).

zeniko, I’m glad you’re here 🙂
My “Mouse Gestures” script is popular in Japan and many people create delivertive versions. It’s a complex issue that how should I determine which is the best version among them. I will collect them (of course, including your versions) and make a new “multifunctional” version.


Zeniko, I tried merging those two samples of code into the script. The first one worked as expected, but the second one did not. It simply didn’t work. (I tried each code separately). Also, a general request. Can a timeout be put in, so that the gesture cancels if the mouse isn’t moved for a period of time (ie one second)?

The two pastebin links are no longer available. Can you at least post the first one again because I would like to see the name of the gesture in the status bar.

@piyo: I’ve uploaded my current version at http://mozilla.zeniko.ch/userchrome.js.html#snippets . It contains the following enhancements to Gomita’s 2007.6.3 version: (1) gesture names are displayed in the status bar; (2) gestures time out after a moment of keeping the mouse still; (3) gestures can access a list with all link URLs you’ve moved over; (4) gestures can contain wildcards (e.g. *UR should mean: any gesture ending in -Up-Right); (5) the list of gestures is slightly nicer to modify.



Thanks for your work ,i found this usefull for my site!