will be generated per frame.
@event{EVT_WEB_VIEW_LOADED(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
- is fully loaded and displayed.
+ is fully loaded and displayed. Note that if the displayed HTML document has
+ several frames, one such event will be generated per frame.
@event{EVT_WEB_VIEW_ERRROR(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
error occurs.
will be generated per frame.
@event{EVT_WEB_VIEW_LOADED(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
- is fully loaded and displayed.
+ is fully loaded and displayed. Note that if the displayed HTML document has
+ several frames, one such event will be generated per frame.
@event{EVT_WEB_VIEW_ERRROR(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
error occurs.
*/
void WebFrame::OnDocumentLoaded(wxWebNavigationEvent& evt)
{
- wxLogMessage("%s", "Document loaded; url='" + evt.GetHref() + "'");
+ //Only notify if the document is the main frame, not a subframe
+ if(evt.GetHref() == m_browser->GetCurrentURL())
+ wxLogMessage("%s", "Document loaded; url='" + evt.GetHref() + "'");
UpdateState();
}
break;
wxString url = evt[1].GetString();
- //As we are complete we also add to the history list
- if(m_historyEnabled && !m_historyLoadingFromList)
+
+ //As we are complete we also add to the history list, but not if the
+ //page is not the main page, ie it is a subframe
+ if(m_historyEnabled && !m_historyLoadingFromList && url == GetCurrentURL())
{
//If we are not at the end of the list, then erase everything
//between us and the end before adding the new page