From 31438f298f114a6c0870179942f22c75b6bdcafe 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 1. Go to any about pages 2. Clone/Reload should work properly --- js/components/frame.js | 13 ++----------- js/state/frameStateUtil.js | 1 + 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/js/components/frame.js b/js/components/frame.js index fdba74ece57..61e672f8767 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} = require('../lib/appUrlUtil') const {isFrameError} = require('../../app/common/lib/httpUtil') const locale = require('../l10n') const appConfig = require('../constants/appConfig') @@ -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 @@ -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': diff --git a/js/state/frameStateUtil.js b/js/state/frameStateUtil.js index 4af752dbefa..e665d011a46 100644 --- a/js/state/frameStateUtil.js +++ b/js/state/frameStateUtil.js @@ -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 }