         to   = to
         niceify to - from
 
-  # Chrome apps open links in a new browser window. OAuth authentication
-  # relies on `window.opener` to be present to communicate back to the
-  # parent window, which isn't available in a chrome app. Therefore, we
-  # disable/change oauth behavior based on this flag: SA.
-  oauthEnabled: -> window.name isnt "chromeapp"
-
   hasPermission: (name) ->
 
     (KD.config.permissions.indexOf name) >= 0

  warnAndLog: (msg, params)->
    warn msg, params
    ErrorLog.create msg, params

  ###
  password-generator
  Copyright(c) 2011 Bermi Ferrer <bermi@bermilabs.com>
  MIT Licensed
  ###
  generatePassword: do ->

    letter = /[a-zA-Z]$/;
    vowel = /[aeiouAEIOU]$/;
    consonant = /[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/;

    (length = 10, memorable = yes, pattern = /\w/, prefix = '')->

      return prefix if prefix.length >= length

      if memorable
        pattern = if consonant.test(prefix) then vowel else consonant

      n   = (Math.floor(Math.random() * 100) % 94) + 33
      chr = String.fromCharCode(n)
      chr = chr.toLowerCase() if memorable

      unless pattern.test chr
        return utils.generatePassword length, memorable, pattern, prefix

      return utils.generatePassword length, memorable, pattern, "" + prefix + chr

  # Version Compare
  # https://github.com/balupton/bal-util/blob/master/src/lib/compare.coffee

              "url=#{encodeURIComponent url}"

    return fullurl


  applyMarkdown: (text, options = {})->

    return null unless text

    options.gfm       ?= true
    options.pedantic  ?= false
    options.sanitize  ?= true
    options.highlight ?= (text, lang) ->
      if hljs.getLanguage lang
      then hljs.highlight(lang,text).value
      else text

    marked Encoder.htmlDecode(text), options


  # This function checks current user's preferred domain and
  # set's it to preferredDomainCookie
