Skip to content

Commit

Permalink
a bit more documentation for WebWindowListener
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Oct 20, 2023
1 parent fd90064 commit 8c45e12
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/site/xdoc/window-frame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
You could think of this as being the first window displayed by a web browser. Calling
WebClient.getPage(WebWindow, WebRequest)
will load the new page into this window.
<br/>
Closing the last (TopLevel)Window of an WebClient will automatically open a new (empty) window.
</p>
<p>
The JavaScript open() function can be used to load pages into other windows. New WebWindow
Expand All @@ -37,21 +39,24 @@
<section name="WebWindowEvents">
<p>
If you wish to be notified when windows are created or pages are loaded, you need to register a
WebWindowListener with the WebClient via the
<a href="apidocs/org/htmlunit/WebWindowListener.html">WebWindowListener</a> with the WebClient via the
method WebClient.addWebWindowListener(WebWindowListener)
</p>
<p>
When a window is opened either by JavaScript or through the WebClient, a WebWindowEvent will be
When a window was opened either by JavaScript or through the WebClient, a WebWindowEvent will be
fired and passed into the
WebWindowListener.webWindowOpened(WebWindowEvent)
method. Note that both the new and old pages in the event will be null as the window does not
have any content loaded at this point. If a URL was specified during creation of the window then the page
method. Note that both the new and old pages in the event will be null as the window does not
have any content loaded at this point. If a URL was specified during creation of the window then the page
will be loaded and another event will be fired as described below.
</p>
<p>
When a new page is loaded into a specific window, a WebWindowEvent will be fired and passed into the
When a new page was loaded into a specific window, a WebWindowEvent will be fired and passed into the
WebWindowListener.webWindowContentChanged(WebWindowEvent) method.
</p>
<p>
When an existing window was close, the WebWindowListener.webWindowClosed(WebWindowEvent) is fired.
</p>
</section>

<section name="Frame Example I">
Expand Down

0 comments on commit 8c45e12

Please sign in to comment.