     )
     
     @api.on 'scriptParsed', (scriptObject)=>@addScript(scriptObject)
+
+    debuggerEnabledPromise
 
 
   close: ->

    if @isActive then throw new Error('Already connected.')
    @onPause ?= ->
    @onResume ?= ->

    debug('starting debugger', wsUrl)
    # the current list of breakpoints is from before this


    @api.once 'connect', =>
      @isActive = true
      
      debuggerEnabledPromise = q.all [
        q.ninvoke @api.debugger, 'enable', null
        q.ninvoke @api.page, 'getResourceTree', null
      ]
      
    @api.once 'close', => @close()

