Exemple #1
0
 /** Creates an instance for a given frame. */
 FrameWindow(final BaseFrame frame) {
   super(frame.getPage().getWebClient());
   frame_ = frame;
   final WebWindowImpl parent = (WebWindowImpl) getParentWindow();
   performRegistration();
   parent.addChildWindow(this);
 }
 /** {@inheritDoc} */
 @Override
 public void setScriptObject(final Object scriptObject) {
   final ScriptableObject so = (ScriptableObject) scriptObject;
   if (so != null) {
     so.put("dialogArguments", so, arguments_);
   }
   super.setScriptObject(scriptObject);
 }
Exemple #3
0
  /** {@inheritDoc} */
  public void setEnclosedPage(final Page page) {
    super.setEnclosedPage(page);

    // we have updated a frame window by javascript write();
    // so we have to disable future updates during initialization
    // see com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames()
    final WebResponse webResponse = page.getWebResponse();
    if (webResponse instanceof StringWebResponse) {
      final StringWebResponse response = (StringWebResponse) webResponse;
      if (response.isFromJavascript()) {
        final BaseFrame frame = getFrameElement();
        frame.setContentLoaded();
      }
    }
  }