From 7aded759ae8e917774aa8063bbfe84f9bc28b6f9 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Fri, 9 Sep 2016 10:59:34 +0800 Subject: [PATCH] Disable feature in private mode --- docs/state.md | 2 +- js/components/frame.js | 2 +- js/components/siteInfo.js | 12 +++++++++-- js/state/contentSettings.js | 9 -------- test/components/navigationBarTest.js | 32 ++++++++++++++++++++++++++-- 5 files changed, 42 insertions(+), 15 deletions(-) diff --git a/docs/state.md b/docs/state.md index 1e86f37b44d..12502143acc 100644 --- a/docs/state.md +++ b/docs/state.md @@ -273,7 +273,7 @@ WindowStore realm: string }, isExtendedValidation: boolean, // is using https ev - runInsecureContent: string, // first domain of running active mixed content + runInsecureContent: boolean, // has active mixed content blockedRunInsecureContent: string, // first domain of blocked active mixed content }, parentFrameKey: number, // the key of the frame this frame was opened from diff --git a/js/components/frame.js b/js/components/frame.js index ad195c52bc0..1540dcb7ec3 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -764,7 +764,7 @@ class Frame extends ImmutableComponent { const runInsecureContent = parsedUrl.protocol === 'https:' && this.runInsecureContent() windowActions.setSecurityState(this.frame, { secure: isSecure, - runInsecureContent: runInsecureContent ? this.props.location : null + runInsecureContent: runInsecureContent }) if (isSecure) { // Check that there isn't a cert error. diff --git a/js/components/siteInfo.js b/js/components/siteInfo.js index c013ef501cb..e5492274b38 100644 --- a/js/components/siteInfo.js +++ b/js/components/siteInfo.js @@ -25,8 +25,9 @@ class SiteInfo extends ImmutableComponent { this.props.onHide() } onDenyRunInsecureContent () { - appActions.removeSiteSetting(siteUtil.getOrigin(this.runInsecureContent), 'runInsecureContent') - ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.runInsecureContent) + appActions.removeSiteSetting(siteUtil.getOrigin(this.location), + 'runInsecureContent', this.isPrivate) + ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.location) this.props.onHide() } get isExtendedValidation () { @@ -47,6 +48,9 @@ class SiteInfo extends ImmutableComponent { get partitionNumber () { return this.props.frameProps.getIn(['partitionNumber']) } + get location () { + return this.props.frameProps.getIn(['location']) + } render () { let secureIcon if (this.isSecure && !this.runInsecureContent) { @@ -97,6 +101,10 @@ class SiteInfo extends ImmutableComponent { } + // Disable in private mode for now + if (this.isPrivate) { + runInsecureContentInfo = null + } return