Skip to content

Do not emit did-fail-load for canceled requests - #6201

Merged
zcbenz merged 1 commit into
masterfrom
did-fail-load
Jun 23, 2016
Merged

zcbenz merged 1 commit into
masterfrom
did-fail-load

Conversation

@zcbenz

@zcbenz zcbenz commented Jun 23, 2016

Copy link
Copy Markdown
Contributor

For all ERR_ABORTED errors happened in DidFailProvisionalLoad, the requests are actually canceled, like:

  • page redirects
  • page starts a download
  • have two calls of loadURL together

Which do not satisfy the use cases of did-fail-load event, and causes surprises to users.

So this PR suppresses ERR_ABORTED for DidFailProvisionalLoad, closes #4396.

@zcbenz
zcbenz merged commit d959ccb into master Jun 23, 2016
@zcbenz
zcbenz deleted the did-fail-load branch June 23, 2016 11:55
Mr0grog added a commit to Mr0grog/nightmare that referenced this pull request Aug 3, 2016
Before v1.2.6, Electron always emitted failure events whenever it emitted provisional failures. Now some types of provisional failures are excepted, so we need to explicitly listen for and handle both.
See: electron/electron#6201
Mr0grog added a commit to Mr0grog/nightmare that referenced this pull request Aug 3, 2016
Before v1.2.6, Electron always emitted failure events whenever it emitted provisional failures. Now some types of provisional failures are excepted, so we need to explicitly listen for and handle both.
See: electron/electron#6201
javan added a commit to javan/electron that referenced this pull request Jan 22, 2017

// Do not emit "did-fail-load" for canceled requests.
if (code != net::ERR_ABORTED)
Emit("did-fail-load", code, description, url, is_main_frame);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zcbenz This is still being emitted on <webview> tag using 2.0.0-beta.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redirect response emits "did-fail-load" event

2 participants