[Techtalk] Double-click selection of words in Firefox

Akkana Peck akkana at shallowsky.com
Tue May 25 10:41:26 EST 2004


Riccarda Cassini writes:
> Does anyone know if there is a way to configure the character set that
> Mozilla/Firefox uses for selecting words when you double-click on them
> in some plaintext page content - i.e. its notion of what a "word" is?
> I wouldn't mind editing config files...

Yes and no.  You can't (currently) configure it with a list of
characters, like you can with xterm-type apps, but:

> I'd like to extract only the pure numbers (without the trailing comma
> or dot) by double-clicking on them, to then cut-and-paste them into

Happily, the one thing you can do is make it stop at punctuation.

In mozilla, it's easy: go to your mozilla profile directory
(probably ~/.mozilla/profilename/blahblah -- wherever prefs.js is)
and edit user.js (create the file if it isn't already there).
Add this line:

user_pref("layout.word_select.stop_at_punctuation", true);

Unfortunately, firefox seems to have a problem with reading user
prefs; in many (not all) cases, prefs specified by the user are
simply ignored.  So for firefox, you'll have to edit the system
prefs, probably something like /etc/mozilla-firefox/pref/unix.js.
Look for the stop_at_punctuation line, and change it from false
to true.  (Then please file a bug against firefox for not honoring
user preferences!  If it's not already filed.)

There is some debate over whether this should be the default on
Linux/Unix platforms.  The down side is that this applies
everywhere, including the urlbar; so doubleclicking will no
longer select the whole url, so you have to triple-click to select
a url.  Opinion is split roughly 50-50 over which way is better.
(Best of all worlds would probably be to stop at punctuation in
most places, but override that in the urlbar.  But nobody has written
a patch to do that.)  If anyone is interested (or better yet, wants
to try writing a patch!), the details live in this bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=190615

	...Akkana


More information about the Techtalk mailing list