Skip to content

Commit

Permalink
Allow about pages to reload and clone
Browse files Browse the repository at this point in the history
fix brave#2826

Auditors: @bridiver, @bbondy

Test Plan:
1. Generate any error pages(connection error, cert error, ...)
2. Clone/Reload should work properly

1. Go to any about pages
2. Clone/Reload should work properly
  • Loading branch information
darkdh committed Oct 18, 2016
1 parent cec105e commit 31438f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 2 additions & 11 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const debounce = require('../lib/debounce')
const getSetting = require('../settings').getSetting
const config = require('../constants/config')
const settings = require('../constants/settings')
const {aboutUrls, isSourceAboutUrl, isTargetAboutUrl, getTargetAboutUrl, getBaseUrl, isNavigatableAboutPage} = require('../lib/appUrlUtil')
const {aboutUrls, isSourceAboutUrl, isTargetAboutUrl, getTargetAboutUrl, getBaseUrl} = require('../lib/appUrlUtil')
const {isFrameError} = require('../../app/common/lib/httpUtil')
const locale = require('../l10n')
const appConfig = require('../constants/appConfig')
Expand Down Expand Up @@ -404,9 +404,6 @@ class Frame extends ImmutableComponent {
}

clone (args) {
if (!isNavigatableAboutPage(getBaseUrl(this.props.location))) {
return
}
const newGuest = this.webview.clone()
const newGuestInstanceId = newGuest.getWebPreferences().guestInstanceId
let cloneAction
Expand All @@ -427,23 +424,17 @@ class Frame extends ImmutableComponent {
this.webview.stop()
break
case 'reload':
if (this.isAboutPage()) {
break
}
// Ensure that the webview thinks we're on the same location as the browser does.
// This can happen for pages which don't load properly.
// Some examples are basic http auth and bookmarklets.
// In this case both the user display and the user think they're on this.props.location.
if (this.webview.getURL() !== this.props.location) {
if (this.webview.getURL() !== this.props.location && !this.isAboutPage()) {
this.webview.loadURL(this.props.location)
} else {
this.webview.reload()
}
break
case 'clean-reload':
if (this.isAboutPage()) {
break
}
this.webview.reloadIgnoringCache()
break
case 'clone':
Expand Down
1 change: 1 addition & 0 deletions js/state/frameStateUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ function cloneFrame (frameOpts, guestInstanceId) {
clone.location = 'about:blank'
clone.src = 'about:blank'
clone.parentFrameKey = frameOpts.key
clone.aboutDetails = frameOpts.aboutDetails
return clone
}

Expand Down

0 comments on commit 31438f2

Please sign in to comment.