}
static gboolean
-wxgtk_webview_webkit_navigation(WebKitWebView *view,
+wxgtk_webview_webkit_navigation(WebKitWebView *,
WebKitWebFrame *frame,
WebKitNetworkRequest *request,
WebKitWebNavigationAction *,
WebKitWebPolicyDecision *policy_decision,
wxWebViewWebKit *webKitCtrl)
{
+ if(webKitCtrl->m_guard)
+ {
+ webKitCtrl->m_guard = false;
+ return FALSE;
+ }
+
webKitCtrl->m_busy = true;
const gchar* uri = webkit_network_request_get_uri(request);
//ourselves
if(handler)
{
+ webKitCtrl->m_guard = true;
wxFSFile* file = handler->GetFile(wxuri);
- g_signal_handlers_block_by_func(view,
- (gpointer)wxgtk_webview_webkit_navigation,
- webKitCtrl);
- webKitCtrl->SetPage(*file->GetStream(), wxuri);
- g_signal_handlers_unblock_by_func(view,
- (gpointer)wxgtk_webview_webkit_navigation,
- webKitCtrl);
+ if(file)
+ {
+ webKitCtrl->SetPage(*file->GetStream(), wxuri);
+ }
+ //We need to throw some sort of error here if file is NULL
+ webkit_web_policy_decision_ignore(policy_decision);
+ return TRUE;
}
return FALSE;
}
{
m_ready = false;
m_busy = false;
+ m_guard = false;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))