Six tips for Firefox 2 – reinstate the Firefox 1.5 close tab button

There has been some discussion on the web lately on how Mozilla for the Firefox 2 codestream has removed the close button at the end of the tab script. It appears you can keep the Firefox 1.5 behaviour by modify a property on the about:config page. Another cool feature I learned from these tips is that you can undo the closing of a tab – nice!!

For more information see Six tips for Firefox 2 over at ZDNet.

Firefox bookmark for doing dns lookups


I do a lot of DNS lookups using dnsstuff.com and finally got around to doing a bookmark for it to make it easier to use. The bookmark makes it possible for me simply to write “dns <hostname> <record-type>” in the address bar of Firefox to do the lookup instead of having to go to the site, locate the field, input the domain name and click the submit button. The bookmark automatically does a lookup for an A-record if no record-type is specified as the second parameter:

Lookup A-record for http://www.example.com dns http://www.example.com
Lookup A-record for http://www.example.com dns http://www.example.com A
Lookup MX-record for example.com dns example.com MX

To add the bookmark to Firefox right-click the following link and add select “Bookmark This Link…”. Once that is done you need to edit the bookmark (right-click it in the bookmark bar and select “Properties”) and add a Keyword (I use “dns”).

Show ‘n Tell Thursday: Automatically insert signature in the Notes/Domino 6/7 forum (22 June 2006)


The script is really simple. If I’m on a form in edit mode (https://www-10.lotus.com/ldd/nd6forum.nsf/*?OpenForm*) it composes the signature, inserts it in the body field and sets focus to the subject field if it’s empty (a new post) or the body field if it’s a reply. Sweet and simple.

// ==UserScript==
// @name          Notes/Domino 6/7 Forum Signature
// @namespace     https://lekkimworld.com/greasemonkey/ldd6_signature
// @description	  Inserts my LDD6/7 Forum signature
// @include       http*://www-10.lotus.com/ldd/nd6forum.nsf/*?OpenForm*
// ==/UserScript==

var e_subject = document.getElementById("Subject");
var e_body = document.getElementById("Body");

// compose signature
var signature = "nn/Mikkel HeisterbergnVisit my Notes/Domino blog " +
    "@ http://lekkimworld.comnfor posts on Notes/Domino " +
    "and how to use Java in Notes/Domino...";

// set signature
e_body.value = signature;

// set focus
if (e_subject.value == "") {
   e_subject.focus();
} else {
   e_body.focus();
   e_body.setSelectionRange(0, 0);
}

To install in Firefox you need Greasemonkey installed. Copy’n’paste the code above to a text file ending in .user.js and then drag the file onto Firefox to install. The tags at the top of the code determines the URL where the script should run, the name of the script etc.

The caveat is the call to the setSelectionRange() method to move the caret to the start of the Body textarea after setting the focus. Without this method the cursor would be at the end of the body field after the signature.

Feel free to change the script if need be…

Updated on 23 June 2006: Small change to make sure the script kicks in when connecting using HTTPS and HTTP.