Detect Opening Folder

Some actions require execution every time you open a folder (for example, registering a custom column handler. To do this you need to capture the select event of the folder [[XUL:tree|tree]] whose id is (conveniently) folderTree like so:

window.document.getElementById('folderTree').addEventListener("select", testColumns, false);