This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only reset the location on provisional load failure
fix #3982 auditors: @bbondy @diracdeltas
- Loading branch information
Showing
1 changed file
with
5 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ const debounce = require('../lib/debounce.js') | |
const getSetting = require('../settings').getSetting | ||
const config = require('../constants/config') | ||
const settings = require('../constants/settings') | ||
const { aboutUrls, isSourceAboutUrl, isTargetAboutUrl, getSourceAboutUrl, getTargetAboutUrl, getBaseUrl, isNavigatableAboutPage } = require('../lib/appUrlUtil') | ||
const { aboutUrls, isSourceAboutUrl, isTargetAboutUrl, getTargetAboutUrl, getBaseUrl, isNavigatableAboutPage } = require('../lib/appUrlUtil') | ||
const { isFrameError } = require('../lib/errorUtil') | ||
const locale = require('../l10n') | ||
const appConfig = require('../constants/appConfig') | ||
|
@@ -825,7 +825,7 @@ class Frame extends ImmutableComponent { | |
interceptFlash(false) | ||
} | ||
} | ||
const loadFail = (e) => { | ||
const loadFail = (e, provisionLoadFailure = false) => { | ||
if (isFrameError(e.errorCode)) { | ||
// temporary workaround for https://github.com/brave/browser-laptop/issues/1817 | ||
if (e.validatedURL === aboutUrls.get('about:newtab') || | ||
|
@@ -851,12 +851,8 @@ class Frame extends ImmutableComponent { | |
}) | ||
windowActions.loadUrl(this.frame, 'about:error') | ||
appActions.removeSite(siteUtil.getDetailFromFrame(this.frame)) | ||
} else { | ||
const currentLocation = this.webview.getURL() | ||
if (currentLocation !== e.validatedURL) { | ||
windowActions.setUrl(isTargetAboutUrl(currentLocation) | ||
? getSourceAboutUrl(currentLocation) : currentLocation, this.props.frameKey) | ||
} | ||
} else if (provisionLoadFailure) { | ||
windowActions.setNavigated(this.webview.getURL(), this.props.frameKey, true) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
bridiver
Author
Collaborator
|
||
} | ||
} | ||
this.webview.addEventListener('load-commit', (e) => { | ||
|
@@ -901,7 +897,7 @@ class Frame extends ImmutableComponent { | |
this.webview.addEventListener('did-fail-provisional-load', (e) => { | ||
if (e.isMainFrame) { | ||
loadEnd(false) | ||
loadFail(e) | ||
loadFail(e, true) | ||
} | ||
}) | ||
this.webview.addEventListener('did-fail-load', (e) => { | ||
|
this doesn't change the security state of the page to that of the old URL. ex: go to https://bing.com, load http://bayden.com/test/redir/goscript.aspx, the URL bar shows https://bing.com but with an unlocked icon. otherwise lgtm.