       unless @elementAttached
         guestViewInternal.destroyGuest guestInstanceId
         return
-      @attachWindow guestInstanceId, false
+      @attachWindow guestInstanceId
     @pendingGuestCreation = true
 
   dispatchEvent: (webViewEvent) ->

  onAttach: (storagePartitionId) ->
    @attributes[webViewConstants.ATTRIBUTE_PARTITION].setValue storagePartitionId

  buildAttachParams: (isNewWindow) ->
    allowtransparency: @attributes[webViewConstants.ATTRIBUTE_ALLOWTRANSPARENCY].getValue()
    autosize: @attributes[webViewConstants.ATTRIBUTE_AUTOSIZE].getValue()
    instanceId: @viewInstanceId
    maxheight: parseInt @attributes[webViewConstants.ATTRIBUTE_MAXHEIGHT].getValue() || 0
    maxwidth: parseInt @attributes[webViewConstants.ATTRIBUTE_MAXWIDTH].getValue() || 0
    minheight: parseInt @attributes[webViewConstants.ATTRIBUTE_MINHEIGHT].getValue() || 0
    minwidth: parseInt @attributes[webViewConstants.ATTRIBUTE_MINWIDTH].getValue() || 0
    # We don't need to navigate new window from here.
    src: if isNewWindow then undefined else @attributes[webViewConstants.ATTRIBUTE_SRC].getValue()
    # If we have a partition from the opener, that will also be already
    # set via this.onAttach().
    storagePartitionId: @attributes[webViewConstants.ATTRIBUTE_PARTITION].getValue()
    userAgentOverride: @userAgentOverride
    httpreferrer: @attributes[webViewConstants.ATTRIBUTE_HTTPREFERRER].getValue()

  attachWindow: (guestInstanceId, isNewWindow) ->
    @guestInstanceId = guestInstanceId
    params = @buildAttachParams isNewWindow

    unless @isPluginInRenderTree()
      @deferredAttachState = isNewWindow: isNewWindow
      return true

    @deferredAttachState = null
    guestViewInternal.attachGuest @internalInstanceId, @guestInstanceId, params, (w) => @contentWindow = w

# Registers browser plugin <object> custom element.


    @beforeFirstNavigation = true
    @contentWindow = null

    # on* Event handlers.
    @on = {}
