     datetime:              rendered (text) ->
       new Date().format if text then text
     decode:                rendered (text) ->
-      decodeURIComponent text
+      if text then decodeURIComponent text
     depth:                 screen.colorDepth
     # Deprecated since 1.0.0, use `linkstarget` instead.
     doanchortarget:        -> @linkstarget
     # Deprecated since 1.0.0, use `linkstitle` instead.
     doanchortitle:         -> @linkstitle
     encode:                rendered (text) ->
-      encodeURIComponent text
+      if text then encodeURIComponent text
     # Deprecated since 0.1.0.2, use `encode` instead.
     encoded:               ->
       encodeURIComponent @url

    originalurl:           tab.url
    os:                    operatingSystem
    param:                 rendered (text) ->
      url.param text
    params:                nullIfEmpty url.param()
    plugins:               _.chain(navigator.plugins).pluck('name').uniq().value()
    popular:               $.extend yes, {}, _.findWhere ext.templates, key: stats.popular
    screenheight:          screen.height
    screenwidth:           screen.width
    segment:               rendered (text) ->
      url.segment parseInt text, 10
    segments:              url.segment()
    select:                ->
      getCallback 'select'

# Avoid repetitive calls to render the text contents of a Mustache section by passed `callback` the
# pre-rendered text and safely handling bad returns.
rendered = (callback) ->
  -> (text, render) ->
    result = if arguments.length then callback(render text) else do callback
    result ? ''

# Attempt to select a tab in the current window displaying a page whose location begins with
# `url`.  
