Still not sure about this check. I don't see why we have to check for docShell.contentViewer before accessing contentTitle. The latter seems to be always present as property on the browser object: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#2559. Or what is the this object here? It's hard to get it from this piece of code.