-
Notifications
You must be signed in to change notification settings - Fork 974
Re-block running insecure content #3808
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,6 +190,9 @@ phone=Phone | |
email=Email | ||
editAddress=Edit Address | ||
editCreditCard=Edit Credit Card | ||
denyRunInsecureContent=Stay Secure | ||
dismissAllowRunInsecureContent=Stay Secure | ||
allowRunInsecureContent=Load Unsafe Scripts | ||
dismissDenyRunInsecureContent=Stay Unsecure | ||
denyRunInsecureContent=Stop Loading Unsafe Scripts | ||
runInsecureContentWarning=This page is trying to load scripts from insecure sources. If you allow this content to run it will not be encrypted and it may transmit unencrypted data to other sites. | ||
denyRunInsecureContentWarning=This page is currently loading scripts from insecure sources. If you disallow this content to run it, transmitting data will be more safe with encrpyted connections. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. second sentence is unnecessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in 138692c. Thanks |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,8 @@ class Frame extends ImmutableComponent { | |
|
||
componentWillUnmount () { | ||
this.expireFlash(this.origin) | ||
// Delete runInsecureContent when the webview is closed | ||
appActions.removeSiteSetting(this.origin, 'runInsecureContent') | ||
} | ||
|
||
updateWebview (cb, newSrc) { | ||
|
@@ -764,7 +766,7 @@ class Frame extends ImmutableComponent { | |
const runInsecureContent = parsedUrl.protocol === 'https:' && this.runInsecureContent() | ||
windowActions.setSecurityState(this.frame, { | ||
secure: isSecure, | ||
runInsecureContent: runInsecureContent | ||
runInsecureContent: runInsecureContent ? this.props.location : null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does location need to be in the securityState? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds better. I will changed to use |
||
}) | ||
if (isSecure) { | ||
// Check that there isn't a cert error. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,18 @@ class SiteInfo extends ImmutableComponent { | |
constructor () { | ||
super() | ||
this.onAllowRunInsecureContent = this.onAllowRunInsecureContent.bind(this) | ||
this.onDenyRunInsecureContent = this.onDenyRunInsecureContent.bind(this) | ||
} | ||
onAllowRunInsecureContent () { | ||
appActions.changeSiteSetting(siteUtil.getOrigin(this.isBlockedRunInsecureContent), 'runInsecureContent', true) | ||
ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.isBlockedRunInsecureContent) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the code above can also use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but that is more of a refactor issue so this looks good to merge now. :) |
||
this.props.onHide() | ||
} | ||
onDenyRunInsecureContent () { | ||
appActions.removeSiteSetting(siteUtil.getOrigin(this.runInsecureContent), 'runInsecureContent') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, you are right. I forgot to add it. |
||
ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.runInsecureContent) | ||
this.props.onHide() | ||
} | ||
get isExtendedValidation () { | ||
return this.props.frameProps.getIn(['security', 'isExtendedValidation']) | ||
} | ||
|
@@ -63,15 +69,26 @@ class SiteInfo extends ImmutableComponent { | |
<span data-l10n-args={JSON.stringify(l10nArgs)} data-l10n-id='sessionInfo' /></li> | ||
} | ||
|
||
let runInsecureContentWarning = null | ||
let runInsecureContentInfo = null | ||
if (this.isBlockedRunInsecureContent) { | ||
runInsecureContentWarning = | ||
runInsecureContentInfo = | ||
<li> | ||
<ul> | ||
<li><span className='runInsecureContentWarning' data-l10n-id='runInsecureContentWarning' /></li> | ||
<li> | ||
<Button l10nId='allowRunInsecureContent' className='secondaryAltButton allowRunInsecureContentButton' onClick={this.onAllowRunInsecureContent} /> | ||
<Button l10nId='denyRunInsecureContent' className='primaryButton denyRunInsecureContentButton' onClick={this.props.onHide} /> | ||
<Button l10nId='dismissAllowRunInsecureContent' className='primaryButton dismissAllowRunInsecureContentButton' onClick={this.props.onHide} /> | ||
</li> | ||
</ul> | ||
</li> | ||
} else if (this.runInsecureContent) { | ||
runInsecureContentInfo = | ||
<li> | ||
<ul> | ||
<li><span className='denyRunInsecureContentWarning' data-l10n-id='denyRunInsecureContentWarning' /></li> | ||
<li> | ||
<Button l10nId='denyRunInsecureContent' className='primaryButton denyRunInsecureContentButton' onClick={this.onDenyRunInsecureContent} /> | ||
<Button l10nId='dismissDenyRunInsecureContent' className='secondaryAltButton dismissDenyRunInsecureContentButton' onClick={this.props.onHide} /> | ||
</li> | ||
</ul> | ||
</li> | ||
|
@@ -86,7 +103,7 @@ class SiteInfo extends ImmutableComponent { | |
partitionInfo | ||
} | ||
{ | ||
runInsecureContentWarning | ||
runInsecureContentInfo | ||
} | ||
</ul> | ||
</Dialog> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Unsecure/Insecure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 138692c. Thanks