   constructor: (graph) ->
     # Prepare the iframe and listen to its state
     @origin = window.location.origin
+    @preview = null
+    @previewObserver = null
 
     super graph
 


  disconnect: (protocol) ->
    @iframe.removeEventListener 'load', @onLoaded, false

    # Stop listening to messages
    window.removeEventListener 'message', @onMessage, false

    @address = preview.src

    # Update iframe contents as needed
    @preview = preview
    if preview.content
      @on 'connected', @updateIframe
    # Update it also if the preview contents change
    @previewObserver = new ObjectObserver preview, @updateIframe

    # Start listening for messages from the iframe
    window.addEventListener 'message', @onMessage, false

  updateIframe: =>
    body = @iframe.contentDocument.querySelector 'body'
    body.innerHTML = @preview.content

  normalizePreview: (preview) ->
    unless preview
