       e.stopPropagation()
       app.vent.trigger 'close_discussion_sidebar'
 
+  if window.parent && window != window.parent
+    senderEnvoy = Factlink.createSenderEnvoy(window.parent)
+    Factlink.createReceiverEnvoy new ClientEnvoy(senderEnvoy)
+  else
+    initDevelopmentConsole()
+    senderEnvoy = ->
+
   senderEnvoy 'modalFrameReady'

        initiallyFocusAddComment: true


window.FactlinkAppMode ?= {}
window.FactlinkAppMode.coreInClient = (app) ->
  app.startClientRegions()

  if window.parent && window != window.parent
    senderEnvoy = Factlink.createSenderEnvoy(window.parent)
    Factlink.createReceiverEnvoy new ClientController(senderEnvoy)
  else
    senderEnvoy = ->

  FactlinkApp.discussionSidebarContainer = new DiscussionSidebarContainer
  FactlinkApp.discussionSidebarRegion.show FactlinkApp.discussionSidebarContainer

class ClientEnvoy
  constructor: (senderEnvoy) ->
    @_senderEnvoy = senderEnvoy

