From 61994b5e27f43ac07d4b4c7f0b4d5c25334c14d5 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Mon, 17 Oct 2016 21:09:55 -0400 Subject: [PATCH] Allow about pages to reload and clone fix #2826 Auditors: @bridiver, @bbondy Test Plan: 1. Generate any error pages(connection error, cert error, ...) 2. Clone/Reload should work properly (reload the original URL) 1. Go to any about pages 2. Clone/Reload should work properly (reload the original URL) --- js/components/frame.js | 19 ++++++++----------- js/components/navigationBar.js | 2 +- js/state/frameStateUtil.js | 1 + 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/js/components/frame.js b/js/components/frame.js index fdba74ece57..d6cdf5bfcf4 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -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, isIntermediateAboutPage} = require('../lib/appUrlUtil') const {isFrameError} = require('../../app/common/lib/httpUtil') const locale = require('../l10n') const appConfig = require('../constants/appConfig') @@ -73,6 +73,10 @@ class Frame extends ImmutableComponent { return aboutUrls.get(getBaseUrl(this.props.location)) } + isIntermediateAboutPage () { + return isIntermediateAboutPage(getBaseUrl(this.props.location)) + } + updateAboutDetails () { let location = getBaseUrl(this.props.location) if (location === 'about:preferences') { @@ -404,9 +408,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 @@ -427,23 +428,19 @@ 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 if (this.isIntermediateAboutPage()) { + this.webview.loadURL(this.props.aboutDetails.get('url')) } else { this.webview.reload() } break case 'clean-reload': - if (this.isAboutPage()) { - break - } this.webview.reloadIgnoringCache() break case 'clone': diff --git a/js/components/navigationBar.js b/js/components/navigationBar.js index 0499a44f833..edec6a8cf19 100644 --- a/js/components/navigationBar.js +++ b/js/components/navigationBar.js @@ -130,7 +130,7 @@ class NavigationBar extends ImmutableComponent { }
{ - isSourceAboutUrl(this.props.location) || this.titleMode + this.titleMode ? null : this.loading ?