X-Mozilla-Status(2) explained :: Mozilla-Features :: Mozilla vs. Antivirus :: Mozilla-Links :: Mozilla-Applications
custom keywords
using keywords with an argument
Base64 en-/decoder
time- & date format
custom keywords
Mozilla has a feature called “Custom Keywords”. It's an easy and inconspicuous feature – but these are often the best. It gives you the power of keyword search like Opera does.
What bookmarks are and how they're created isn't part of this text. How they're used should be clear: scanning the bookmark menu for the desired page and clicking. This will take, depending on the organization of your bookmark collection, between a twinkle and ages. But Mozilla gives you the possibility to call a bookmark using a keyword.
To assign this, open your Bookmark Manager (e.g. via CTRL+B), choose the Bookmark and open its properties (e.g. via CTRL+I) – you'll see this dialog (in Mozilla, in Firefox it looks different): 
The key now literally is the field “Keyword”. What's to be entered here is a (short) string which will, entered as URL, be replaced by the text in the “Location” field and executed like every other bookmark.
In the example “bug” as URL will call Bugzilla and display bug %s.
using keywords with an argument
Er, wait a sec, %s? That's no valid bug number – Bugzilla will tell you, if you open http://bugzilla.mozilla.org/show_bug.cgi?id=%s. But here it's in fact a feature in a feature.
That's because Mozillas bookmarks take arguments too! Everything entered in the URL bar behind the keyword and a space will be taken as argument: “bug 30651” calls (the by the way amusing) bug 30651. So it saves you from visiting http://bugzilla.mozilla.org, selecting the edit field and entering “30651”.
That works with any page which uses the GET method for submitting entered data. The URL looks mostly cryptic, but is easy to utilize.
Just enter e.g. the search term “Mozilla” into your favorite search engine and see what it generates – Google will convert it to “http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Mozilla&btnG=Google+Search”. Then bookmark the result, replace the search term with %s and enter a keyword, “go” for example. Done
A few examples:
- http://www.google.de/search?hl=de&ie=UTF-8&oe=UTF-8&q=%s&btnG=Google-Suche&meta=
- http://dict.leo.org/?search=%s&searchLoc=0&relink=on&deStem=standard&lang=de
- http://en.wikipedia.org/w/wiki.phtml?search=%s
- http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=%s&Find=Find
- http://cgi.ebay.de/ws/eBayISAPI.dll?ViewItem&item=%s
- http://www.imdb.com/find?tt=on;nm=on;mx=20;q=%s
- http://lxr.mozilla.org/seamonkey/ident?i=%s
And there are dozends more.
This tutorial bases on http://www.mozilla.org/docs/end-user/keywords.html
Base64 en-/cecoder
The features described above can be used for another nice trick. Mozilla provides internal functions for encoding and decoding Base64 strings. These can also be used by the user via Javascript, their names: btoa (->Base64) und atob (->Text).
Create a bookmark with address “javascript:btoa(%22%s%22)” (%22 is an url encoded quotation mark) and keyword “b64e”, resp. “javascript:atob(%22%s%22)” and keyword “b64d”.
So the conversion of text in a Base64 string is a matter of “b64e Test”. To reverse this process just type “b64d VGVzdA==”.
time- & date format
global date format
In order to format time- and date strings, Mozilla obeys the systems format. On Unices various locale environment variables are used, the order of evaluation is system dependant. For glibc on Linux it is LC_ALL, LC_TIME, LANG. Populated with the according locale you can Mozilla make to display all standardised formats. Examples:
de_DE = 31.12.1999
en_US = 12/31/1999
en_GB = 31/12/99
en_DK = 1999-12-31 (ISO 8601:1988)
These variables also define the default for the date format to be used in attribution line of replies. To use another date format for this line independently of the format used elsewhere there's the hidden pref mailnews.reply_header_locale. It needs a hyphen instead of an underscore, i.e. "de-DE" for example.
On Unices this option unfortunatelly didn't work for a long time because of a bug, so everything else then empty ("") or "en_US" respectively gave also en_US. As of now this bug has been fixed though for all not using nightlies it will not be available before release of Thunderbird 3.0 and SeaMonkey 2.0 respectively. In the meantime on Unices remove this pref and leave the control to the variables.
BTW, to get the format according to ISO 8601:1988 in the attribution line on Windows you've to use the locale “sv-SE”. This also works on Linux, that locale has to be installed however. Since it isn't on most systems, it's easier to use before named en_DK there.
Date column
Among others, the thread pane of the mail client can show a date column. By default it is configured so that it will show only the time for messages from today, no date. All others show the full date and time of the format 31.12.1999 23:59.
Many users don't know that this behaviour can be configured as well. I don't know why—it can't only be the lack of a UI (where the extension below is a remedy), other, more well known prefs, don't have one too.
Responsible for the configuration are the following prefs (editable through the URL about:config or the file prefs.js resp. user.js in profile folder):
mail.ui.display.dateformat.default
mail.ui.display.dateformat.today
mail.ui.display.dateformat.thisweek
0 = no date (23:53)
1 = long date format (e.g. Freitag, 31. Dezember 1999 23:53)
2 = short date format (e.g. 31.12.1999 23:53)
3 = year/month (1999/12 23:53)
4 = weekday (Fr 23:53)
(examples in de_DE format with 24 hours, your display will be in your system format)
The actual look of the short resp. long format (e.g. “Fr” instead of “Friday”) is configurable through the operating system.
On Unix systems the long is equal the short format, it's generated by calling strftime with format string %x (so what “date +%x” displays on the console).
E.g.: The following configuration shows the time only for todays mails, weekday and time for mails from within the last 7 days (excluding today) and full date with time for all other:
user_pref(”mail.ui.display.dateformat.default”, 2);
user_pref(”mail.ui.display.dateformat.today”, 0);
user_pref(”mail.ui.display.dateformat.thisweek”, 4);
The format for Time/Date in the mail header isn't affected by this prefs.
Mailheader
Normaly date and time of the current message are converted to the timezone of your computer. But for some users/uses it would be useful to have the date and time displayed in the senders timezone – including the timezone (e.g. +0100 resp. MET).
Unfortunately this isn't possible due to internal reasons (frozen interface of low-level functions).
Therefore some time ago I introduced a way to at least directly show the date-string from the mail header. That has a few drawbacks, like not always the same format, particularly also localized names for weekdays and month (i.e. for example Die (german for Thu) on a english system), but that was the only way.
The associated pref is called mailnews.display.original_date – an UI doesn't exist.
It's activated by user_pref("mailnews.display.original_date", true); “false”, resp. removing the pref, switches it off again.
The format for Time/Date of the thread panes date column isn't affected by this pref.
Since a while the extension ConfigDate for Thunderbird addresses the lack of an UI for the named prefs. So you can now adjust the dates without manually twiddling in the prefs.