From af70b2170558cc94058e23b217c9a1fe43a8b1ef Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 9 Aug 2010 20:04:13 +0000 Subject: [PATCH] Ignore navigation to invalid URLs (issue #104). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@94 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser_webview_delegate.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index 409346c5d..aa6729d78 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -560,8 +560,11 @@ WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( if(handler.get()) { // Gather browse request information CefRefPtr req(CefRequest::CreateRequest()); - + GURL request_url = request.url(); + if (!request_url.is_valid()) + return WebKit::WebNavigationPolicyIgnore; + req->SetURL(UTF8ToWide(request_url.spec())); req->SetMethod( UTF8ToWide(webkit_glue::WebStringToStdString(request.httpMethod())));