From 3935f58ae5e89a4cf278a293f9c5a8e699885559 Mon Sep 17 00:00:00 2001 From: yan Date: Mon, 26 Jun 2017 17:09:39 -0700 Subject: [PATCH] Send isSecure false instead of null when an insecure site has passive mixed content Fix https://github.com/brave/browser-laptop/issues/9652 If a site is already insecure and receives passive mixed content, the security state should remain insecure instead of changing to unknown. Test Plan: 1. go to https://video.foxbusiness.com/v/5068842750001/?#sp=show-clips 2. click 'allow ads' so that the video will play 3. the URL bar icon should not disappear when the video starts --- app/renderer/components/frame/frame.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/renderer/components/frame/frame.js b/app/renderer/components/frame/frame.js index 8113e45ec6f..34a47bc33fd 100644 --- a/app/renderer/components/frame/frame.js +++ b/app/renderer/components/frame/frame.js @@ -707,12 +707,11 @@ class Frame extends React.Component { isSecure = false const parsedUrl = urlParse(this.props.location) ipc.send(messages.CHECK_CERT_ERROR_ACCEPTED, parsedUrl.host, this.props.frameKey) - } else if (this.props.isSecure !== false && - ['warning', 'passive-mixed-content'].includes(e.securityState)) { + } else if (['warning', 'passive-mixed-content'].includes(e.securityState)) { // Passive mixed content should not upgrade an insecure connection to a // partially-secure connection. It can only downgrade a secure // connection. - isSecure = 1 + isSecure = this.props.isSecure !== false ? 1 : false } windowActions.setSecurityState(this.frame, { secure: runInsecureContent ? false : isSecure,