browser: emit did-fail-load for invalid url
This commit is contained in:
parent
027b5345f8
commit
5a8bebc2f8
2 changed files with 21 additions and 4 deletions
|
@ -710,6 +710,14 @@ bool WebContents::Equal(const WebContents* web_contents) const {
|
|||
}
|
||||
|
||||
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
|
||||
if (!url.is_valid()) {
|
||||
Emit("did-fail-load",
|
||||
static_cast<int>(net::ERR_INVALID_URL),
|
||||
net::ErrorToShortString(net::ERR_INVALID_URL),
|
||||
url.possibly_invalid_spec());
|
||||
return;
|
||||
}
|
||||
|
||||
content::NavigationController::LoadURLParams params(url);
|
||||
|
||||
GURL http_referrer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue