Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Don't save site info wrong sometimes
Browse files Browse the repository at this point in the history
Fix #1646. Fix #2114

Auditors: @aekeus
  • Loading branch information
bbondy committed Jun 23, 2016
1 parent 8b51163 commit e44d45e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,15 @@ class Frame extends ImmutableComponent {
this.webview.executeJavaScript('Navigator.prototype.__defineGetter__("doNotTrack", () => {return 1});')
}
}
const loadEnd = () => {
const loadEnd = (savePage) => {
windowActions.onWebviewLoadEnd(
this.props.frame,
this.webview.getURL())

const parsedUrl = urlParse(this.props.frame.get('location'))
const protocol = parsedUrl.protocol
const isError = this.props.frame.getIn(['aboutDetails', 'errorCode'])
if (!this.props.frame.get('isPrivate') && (protocol === 'http:' || protocol === 'https:') && !isError) {
if (!this.props.frame.get('isPrivate') && this.props.frame.get('provisionalLocation') === this.props.frame.get('location') && (protocol === 'http:' || protocol === 'https:') && !isError && savePage) {
// Register the site for recent history for navigation bar
appActions.addSite(siteUtil.getDetailFromFrame(this.props.frame))
}
Expand Down Expand Up @@ -622,22 +622,22 @@ class Frame extends ImmutableComponent {
})
this.webview.addEventListener('did-fail-provisional-load', (e) => {
if (e.isMainFrame) {
loadEnd()
loadEnd(false)
loadFail(e)
}
})
this.webview.addEventListener('did-fail-load', (e) => {
if (e.isMainFrame) {
loadEnd()
loadEnd(false)
loadFail(e)
}
})
this.webview.addEventListener('did-finish-load', () => {
loadEnd()
loadEnd(true)
})
this.webview.addEventListener('did-navigate-in-page', (e) => {
windowActions.setNavigated(e.url, this.props.frame.get('key'), true)
loadEnd()
loadEnd(true)
})
this.webview.addEventListener('enter-html-full-screen', () => {
windowActions.setFullScreen(this.props.frame, true, true)
Expand Down

0 comments on commit e44d45e

Please sign in to comment.